The type/object distinction and possible synthesis of OOP and imperative programming languages
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Tue Apr 16 01:59:23 EDT 2013
On Mon, 15 Apr 2013 21:56:12 -0700, rusi wrote:
> On Apr 16, 7:32 am, Steven D'Aprano <steve
> +comp.lang.pyt... at pearwood.info> wrote:
>>
>> If I had a say in this, I would vote for the first case, with the
>> possible exception of documented singleton types like NoneType and
>> bool.
>
> How is bool a singleton type?
A doubleton, then.
The point being, GvR declared that bool should guarantee the invariant
that True and False are the only instances of bool, and if you can
subclass it, either that invariant is violated, or you can't instantiate
the subclass.
--
Steven
More information about the Python-list
mailing list