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
Greg Ward
2002-05-23
On 23 May 2002, Andrew Kuchling said:
> In Python 2.2, there's types.StringTypes which is a tuple containing
> the string types:

OK, OK, final definition of is_string():

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

      def isstring (x):
          return type(x) in _string_types

The fact that this caused the most response indicates that my patch is
good.  I'll go check it in now.  One more big change for Quixote 0.5!

        Greg


reply