isinstance(<maybe_string>, basestring if PY2 else str)
using different classes
# Python 2.6 doesn't properly UTF-8 encode syslog messages, so it needs
# to be performed in a custom formatter.
formatter_class = UnicodeLoggingFormatter if PY26 else logging.Formatter
there are a few modules that are simply at different locations but have the same API
constants is string using different classes