[Python-Dev] bytes.from_hex() (original) (raw)
Michael Hudson mwh at python.net
Sun Feb 19 11:36:09 CET 2006
- Previous message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Next message: [Python-Dev] bytes.from_hex()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"M.-A. Lemburg" <mal at egenix.com> writes:
Martin v. Löwis wrote:
M.-A. Lemburg wrote:
True. However, note that the .encode()/.decode() methods on strings and Unicode narrow down the possible return types. The corresponding .bytes methods should only allow bytes and Unicode. I forgot that: what is the rationale for that restriction?
To assure that only those types can be returned from those methods, ie. instances of basestring, which in return permits type inference for those methods. Hmm. So it for type inference???? Where is that documented? Somewhere in the python-dev mailing list archives ;-) Seriously, we should probably add this to the documentation.
Err.................. I don't think this is a good argument, for quite a few reasons. There certainly aren't many other features in Python designed to aid type inference and the knowledge that something returns "unicode or str" isn't especially useful...
Cheers, mwh
-- ROOSTA: Ever since you arrived on this planet last night you've been going round telling people that you're Zaphod Beeblebrox, but that they're not to tell anyone else. -- The Hitch-Hikers Guide to the Galaxy, Episode 7
- Previous message: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]
- Next message: [Python-Dev] bytes.from_hex()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]