[I know we've already reached agreement, but I feel the need to stick my oar in.] Barry A. Warsaw wrote: > > NS> Perhaps we could extend isinstance(). How about > > NS> isinstance(x, str, unicode) > > NS> or > > NS> isinstance(x, (str, unicode)) > > NS> This is a common problem not limited to string types. I often > NS> want to test if something is a tuple or a list for example. > > That's an interesting idea, but please use the former signature, not > the latter. Ewww, gross, spit spit spit. ;-) At least with the latter, you can do: stringtype = (str, unicode) isinstance(x, stringtype) Hmmmm... Or can you? -- --- Aahz (@pobox.com) Hugs and backrubs -- I break Rule 6 <*> http://www.rahul.net/aahz/ Androgynous poly kinky vanilla queer het Pythonista We must not let the evil of a few trample the freedoms of the many.
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