You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You cannot use the subscripted class (e.g. ``Node[int]``) directly in
an expression -- you must define a type alias. (This restriction
exists because creating the subscripted class, e.g. ``Node[int]``, is
an expensive operation -- usually many times as expensive as
constructing an instance of it. Using a type alias is also more
readable.)
However, __getitem__ is cached for generics now and this leads to significant speedup (Guido reported up to 300x speedup in extreme cases). I think the above restriction is not necessary anymore and could be removed from the PEP.