[Python-Dev] bool does not want to be subclassed? (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sat Feb 14 08:28:32 EST 2004
- Previous message: [Python-Dev] bool does not want to be subclassed?
- Next message: [Python-Dev] bool does not want to be subclassed?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tim Peters wrote:
I expect the easiest way out is for you to decide that type objects are immutable after all -- even if there are obscure ways to mutate them!
It's not at all obscure:
class A(object):pass ... type(A).name 'type' A.foo = 1 A.foo 1
Look, Ma, I'm mutating a type! No, son, you are just modifying it.
The properties you quote (comparison checks for identity, usable as a dictionary key) don't imply at all that an object is immutable.
Regards, Martin
- Previous message: [Python-Dev] bool does not want to be subclassed?
- Next message: [Python-Dev] bool does not want to be subclassed?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]