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
The way this works now, the VariantFunction descriptor will create a new VariantMethod at least for every instance of the parent class, possibly on every lookup of either the primary or one of the variants. This is particularly problematic because instantiating a VariantMethod actually eagerly binds every variant at lookup time.
I believe that we can fix this by changing VariantMethod so that rather than eagerly creating bound method variants for every variant of the primary when instantiated, we have a lookup table that lazily creates them in __getattr__.
The big caveat here is that if you just do it the naive way, I'm fairly certain that it will ruin introspection and (probably ruin documentation generation as a consequence), so I think we'll also have to be clever about the introspection.
The text was updated successfully, but these errors were encountered:
The way this works now, the
VariantFunction
descriptor will create a newVariantMethod
at least for every instance of the parent class, possibly on every lookup of either the primary or one of the variants. This is particularly problematic because instantiating aVariantMethod
actually eagerly binds every variant at lookup time.I believe that we can fix this by changing
VariantMethod
so that rather than eagerly creating bound method variants for every variant of the primary when instantiated, we have a lookup table that lazily creates them in__getattr__
.The big caveat here is that if you just do it the naive way, I'm fairly certain that it will ruin introspection and (probably ruin documentation generation as a consequence), so I think we'll also have to be clever about the introspection.
The text was updated successfully, but these errors were encountered: