a=\'aaaa\' print isinstance(a, basestring)#true print isinsta开发者_开发百科nce(a, str)#true In Python versions prior to 3.0 there are two kinds of strings \"plain strings\" and \"unicode strings\". P
EDIT: Note that this is a REALLY BAD idea to do in production code. This was just an interesting thing for me. Don\'t do this at home!
I\'m experimenting with bytes vs bytearray in Python 2.6. I don\'t understand the reason for some differences.
I have tried to use Python\'s ConfigParser module to save settings. For my app it\'s important that I preserve the case of each name in my sections. The docs mention that passing str() to ConfigParser