vbuterin / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
1.3k stars 861 forks source link

spreading the string or unicode check for variables. #48

Closed nelisky closed 9 years ago

nelisky commented 9 years ago

Some cases had only str while others both str and unicode. I came across a specific case where having only str broke it for me.

Nitpicking a bit the 'proper' way to do this would be:

from types import StringTypes

if isinstance(var, StringTypes):
  # do something

as there's always a chance another string type gets added to the core lib (though I seriously doubt it).