[Python-3000] Type parameterization (was: Re: Type annotations: annotating generators)

Jim Jewett jimjjewett at gmail.com
Fri May 19 23:24:09 CEST 2006


On 5/19/06, Collin Winter <collinw at gmail.com> wrote:
> B.__parameterize__ will only be called in the case of B[x] (as opposed
> to B()[x]).

new-style classes (the ones sticking around for python 3) are also instances.

    >>> isinstance(dict, type) and isinstance(dict, object)
    True

How can the interpreter know which interpretation to use?

When proposing a rule, remember to consider classes which are supposed
to have only a single instance (similar to a JSP).  Even if you
normally separate classes from instances, the line between "class" and
"the only instance of the class" can get kind of blurry.

-jJ


More information about the Python-3000 mailing list