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
Regular PY bound method objects have a __self__ attribute, pointing to the object they are bound to.
Would be great to be able to have the same for asynq()ed methods.
In [36]: class A:
...: def foo():
...: pass
...: @asynq()
...: def bar():
...: pass
...:
In [37]: A().foo.__self__.__class__ is A
Out[37]: True
In [38]: A().bar.__self__.__class__ is A
Traceback (most recent call last):
File "/.../venv/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-38-a140d1d32042>", line 1, in <module>
A().bar.__self__.__class__ is A
AttributeError: 'asynq.decorators.AsyncDecoratorBinder' object has no attribute '__self__'
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-38-a140d1d32042> in <module>()
----> 1 A().bar.__self__.__class__ is A
AttributeError: 'asynq.decorators.AsyncDecoratorBinder' object has no attribute '__self__'
The text was updated successfully, but these errors were encountered:
You can currently already do this with .instance; I agree that it would be more consistent to support __self__ though. I submitted quora/qcore#70 to fix this.
Regular PY bound method objects have a
__self__
attribute, pointing to the object they are bound to.Would be great to be able to have the same for
asynq()
ed methods.The text was updated successfully, but these errors were encountered: