singleton objects with decorators

Steve Holden steve at holdenweb.com
Tue Apr 12 15:59:22 EDT 2005


Bengt Richter wrote:
[...]
> It's a weird beast, being a subtype of int also. I'll defer to the BDFL in
> http://www.python.org/peps/pep-0285.html
> 
> """
>     The values False and True will be singletons, like None.  Because
>     the type has two values, perhaps these should be called
>     "doubletons"?  The real implementation will not allow other
>     instances of bool to be created.
> """
> 
> Regards,
> Bengt Richter

It would probably make sense (IMHO) to deny rebinding of True and False 
in the same way that 2.4 denies rebinding of None. Given that people 
would set True and False themselves in order to make their pre-2.4 code 
readable, however, this may overstress backward compatibility.

regards
  Steve
-- 
Steve Holden        +1 703 861 4237  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/




More information about the Python-list mailing list