We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
consider the following functional code:
import mpv player = mpv.MPV() def foo(ev): print(ev) player.register_event_callback(foo)
This works as expected.
If however, I try to register not a function, but a (class-)method instead, I get an AttributeError:
AttributeError
class Bar: def baz(self, ev): print(ev) player.register_event_callback(Bar().baz)
~/.local/lib/python3.6/site-packages/mpv.py in register_event_callback(self, callback) 816 my_handler.unregister_mpv_events() 817 """ --> 818 callback.unregister_mpv_events = partial(self.unregister_event_callback, callback) 819 self._event_callbacks.append(callback) 820 AttributeError: 'method' object has no attribute 'unregister_mpv_events'
Is there a way of fixing this?
The text was updated successfully, but these errors were encountered:
I've removed that now. Try again with the current master or v0.2.7 from PyPI and it should work.
Sorry, something went wrong.
That worked, thanks a lot!
No branches or pull requests
Hello,
consider the following functional code:
This works as expected.
If however, I try to register not a function, but a (class-)method instead, I get an
AttributeError
:Is there a way of fixing this?
The text was updated successfully, but these errors were encountered: