2006/7/6, JoeSox <[EMAIL PROTECTED]>:
> 221:        if isinstance(s, unicode):
> 222:            s = str(s)

Eh, some Python codes assume "isinstance(s, str)" and "isinstance(s,
unicode)" can't be both true. IMO this should be discouraged. For
example, one serialization library registers serialization handlers
for str and unicode, and raises(!) if a handler is registered twice
for the same type. Of course this won't work in IronPython.

The assumption also doesn't hold in Jython. str and unicode are
functions, not types in Python 2.1, which Jython implements. To test,
try type('') == type(u'').

Seo Sanghyeon
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to