"Martin v. Loewis" wrote: > > > Sounds like we ought to do a search-and-destroy on type comparisons, > > replacing with isinstance() where possible. > > At least in my applications, this is unfortunately not possible: I > want a test for byte-string-or-unicode-string. This could be done with > two isinstance calls, but that is certainly less efficient. > > Marc-Andre once proposed a type representing the immediate supertype > of both byte strings and unicode strings; let's call it abstract string. > Then I could write isinstance(e, types.AbstractString). I'm still holding on to that idea... hopefully, Guido's type checkins will make this possible in 2.2 or 2.3. The same should then be done for numbers, sequences and mappings (all abstract "types" defined in abstract.c). -- Marc-Andre Lemburg ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4