[Python-ideas] add __contains__ into the "type" object

Pavol Lisy pavol.lisy at gmail.com
Wed Mar 1 23:38:37 EST 2017


On 3/1/17, Steven D'Aprano <steve at pearwood.info> wrote:
> On Wed, Mar 01, 2017 at 07:02:23AM +0800, 语言破碎处 wrote:
>>
>> where we use types?
>>     almost:
>>         isinstance(obj, T);
>>         # issubclass(S, T);
>>
>> Note that TYPE is SET;
>
> What does that mean? I don't understand.

Maybe she/he wants to say that it is natural to see class as a
collection (at least in set theory
https://en.wikipedia.org/wiki/Class_(set_theory) )


More information about the Python-ideas mailing list