> class S(str): > def __str__(self): return "S.__str__" > > class U(unicode): > def __str__(self): return "U.__str__" > > print str(S()) > print str(U()) > > This script prints: > > S.__str__ > U.__str__
Yes, but "print U()" prints nothing, and the explicit str() should not be necessary. Mike _______________________________________________ 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