This may seem simple and trivial, but today I discovered the
basestring type in Python. It is essentially a base type for
unicode, which comes in handy when writing
isinstance(foo, basestring) in test code for example.
Strangely, despide PEP 237 mentioning the equivalent for
long as "
integer" I can't actually find what has become of that, so still writing
isinstance(foo, (int, long)) for now.
Note that this is Python 2.x only, in 3.x it's all unicode so there is no longer a need for a common base type.
long are unified as well in Python 3.x obviously.