[Python-Dev] bool does not want to be subclassed?

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Thu Feb 12 19:50:52 EST 2004


> From: Joshua Marshall
> 
> I don't think I'm convinced; the same argument could be used 
> for integers (if it doesn't make sense to create a sort of 
> boolean which isn't in the set { true, false }, then it 
> doesn't make sense to create a sort of integer which isn't in 
> the set { ..., -2, -1, 0, 1, 2, ... }).  And maybe it 
> doesn't, but this isn't the only reason for subclassing.  
> Another reason for subclassing is to create items which can 
> act like existing objects, but which have some additional behavior.

So should we be able to subclass NoneType so as to break the invariant that there is one and only one None instance?

Tim Delaney



More information about the Python-Dev mailing list