Re: python-dbus: Monitoring a remote system bus

Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Geek Central
Message-ID <[email protected]>
On Tue, 4 Sep 2018 22:51:29 +0000, Kipper, Matthew wrote:

> It looks like when I invoke MySystemBus(), Connection.__init__
> (https://github.com/posborne/dbus-python/blob/master/dbus/connection.py#L257)
> never runs ...

OK, this looks like a Python question, rather than a dbus question.
Looking at the spec for __new__
<https://docs.python.org/3/reference/datamodel.html#special-method-names>,
I think this line is relevant:

    If __new__() does not return an instance of cls, then the new
    instance’s __init__() method will not be invoked.

Because you are returning an instance of the superclass, not the class
itself. So if you want the superclass __init__ method invoked, you have
to do it yourself.

By the way, while I was able to get most of the Python language into my
head after a few months’ use, that section (“Special Method Names”)
is one I still keep referring back to.
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.