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
[In http://bugs.python.org/issue25087 Stefan Krah wrote:]
If a type scheme is instantiated, should the type variables in the
class body be substituted? This is an example (typed by hand on
a locked down Windows machine, may contain errors):
Unfortunately this info is hard to retrieve at run time. The object returned by the expression IntIntTuple.__init__ is a plain function -- it only knows that it was defined in ABTuple. You could write a custom function though that is passed in separately the IntIntTuple class and the string '__init__' -- it can then do the expansion for you after introspection of IntIntTuple. (See also #136 (comment) and further comments).
Activity
gvanrossum commentedon Sep 13, 2015
Unfortunately this info is hard to retrieve at run time. The object returned by the expression
IntIntTuple.__init__is a plain function -- it only knows that it was defined inABTuple. You could write a custom function though that is passed in separately theIntIntTupleclass and the string'__init__'-- it can then do the expansion for you after introspection ofIntIntTuple. (See also #136 (comment) and further comments).Refactor Union, Tuple, and Callable (#308)