Proposal for adding symbols within Python
Björn Lindström
bkhl at stp.lingfil.uu.se
Mon Nov 14 16:55:51 EST 2005
Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> Why does the byte string "\x6f\x70\x65\x6e\x65\x64" have intrinsic
> meaning when the int 0 doesn't? It certainly doesn't mean anything to
> non-English speakers.
>
> If all you want is human readable byte strings, then just use them:
>
> class MyFile:
> def open(self):
> self.state = "opened"
> def close(self):
> self.state = "closed"
So, I guess no one read my explanation of why this an issue about more
than implementing enums (which is fairly trivial, as we have seen).
--
Björn Lindström <bkhl at stp.lingfil.uu.se>
Student of computational linguistics, Uppsala University, Sweden
More information about the Python-list
mailing list