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
I was wondering if it would be possible to have the option to ignore errors such as NameErrors from forward references while accessing the methods attribute of a dispatched function. I'm using the autoslot package which takes all the assignments to self variables in a class' __init__ method and and adds them to __slots__; however, if I use a forward reference to the same class I'm defining the __init__ method for, I get a NameError. For example:
Since I'm using Counter as a forward reference in __init__, it errors out when accessing __init__'s methods attribute. Would it be possible to implement a method that will ignore NameErrors due to forward references at the user's peril, and move on to the next method in the methods' list (like just the last two __init__ methods in my example instead of all three), or is that beyond the scope of the project?
Thank you kindly for the help!
The text was updated successfully, but these errors were encountered:
I realize now that the _pending attribute may also work, as the collected methods seem not to be resolved during class initialization. I'll go ahead and close this, then.
Combining _pending and _resolved worked perfectly, though perhaps a property _all might be helpful to combine the two, just to access all the function details in the current dispatcher!
Hello!
Sorry for bothering you so many times! 😅
I was wondering if it would be possible to have the option to ignore errors such as
NameErrors
from forward references while accessing themethods
attribute of a dispatched function. I'm using the autoslot package which takes all the assignments toself
variables in a class'__init__
method and and adds them to__slots__
; however, if I use a forward reference to the same class I'm defining the__init__
method for, I get aNameError
. For example:Since I'm using
Counter
as a forward reference in__init__
, it errors out when accessing__init__
'smethods
attribute. Would it be possible to implement a method that will ignoreNameErrors
due to forward references at the user's peril, and move on to the next method in the methods' list (like just the last two__init__
methods in my example instead of all three), or is that beyond the scope of the project?Thank you kindly for the help!
The text was updated successfully, but these errors were encountered: