Oct. 5, 2001
3:21 p.m.
Neil Schemenauer wrote:
isinstance(x, str, unicode)
...
This is a common problem not limited to string types. I often want to test if something is a tuple or a list for example.
Guido van Rossum writes:
You may be on to something. It certainly saves me inventing a new name! I'll think about it a bit more...
I like this approach. It also doesn't preclude the other changes. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation