Chris Angelico wrote:
Fascinating! What about: except sys.intern('type error') ? Or does interning of strings not exist yet :)
Even if it was, I don't think there was any guarantee that the "official" strings representing those exceptions would be interned. You were supposed to use the provided names to refer to built-in exceptions, to make sure you were referring to the same object. Doing so also had the nice benefit that when exceptions became classes, most existing exception-handling code continued to work unchanged. It's almost like Guido had a time machine! -- Greg -- https://mail.python.org/mailman/listinfo/python-list