durusmail: quixote-users: Proposed change to _q_getname() interface
Proposed change to _q_getname() interface
2002-05-23
2002-05-23
2002-05-23
2002-05-23
2002-05-23
2002-05-23
Proposed change to _q_getname() interface
Neil Schemenauer
2002-05-23
I think this is better:

   if sys.hexversion >= 0x02020000:    # Python 2.2 or greater
       def isstring (x):
           return isinstance(x, types.StringTypes)
    else:
       def isstring (x):
           return type(x) in (types.StringType, types.UnicodeType)

No use doing the version check on every hit.

  Neil


reply