On 2005 Jan 19, at 11:10, Bob Ippolito wrote:

Do you REALLY think this should be True?!
    isinstance(foo, unicode) and foo != unicode(foo)

Hmmmm -- why not? In the generic case, talking about some class B, it certainly violates no programming principle known to me that "isinstance(foo, B) and foo != B(foo)"; it seems a rather common case -- ``casting to the base class'' (in C++ terminology, I guess) ``slices off'' some parts of foo, and thus equality does not hold. If this is specifically a bad idea for the specific case where B is unicode, OK, that's surely possible, but if so it seems it should be possible to explain this in terms of particular properties of type unicode.



Alex

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to