Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Iterate interfaces in the MRO reversed order #105

New issue

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

Merged
merged 1 commit into from
Jun 21, 2025

Conversation

arkq
Copy link
Contributor

@arkq arkq commented Jun 12, 2025

Iterating the MRO in the reversed order will allow to add interfaces to the given object in a well-defined way - always starting from the base class. Such ordering will be compatible with adding interfaces manually one by one.

@igo95862
Copy link
Collaborator

Hello @arkq

Thank you for submitting this pull request. Could you add some unit tests to verify the behavior?

Hmmm... I plan on adding a simple introspection parser in the next version. Maybe that could be used to verify the order of introspection interfaces.

@arkq
Copy link
Contributor Author

arkq commented Jun 13, 2025

Could you add some unit tests to verify the behavior?

Yes I can add some tests for that, but not before the next week.

Iterating the MRO in the reversed order will allow to add interfaces to
the given object in a well-defined way - always starting from the base
class. Such ordering will be compatible with adding interfaces manually
one by one.
@arkq
Copy link
Contributor Author

arkq commented Jun 16, 2025

Maybe that could be used to verify the order of introspection interfaces.

The introspection data depends on the libsystemd implementation (that was my first try when implementing test cases for that). Instead of that I've added a test which checks the order of registration, because this library controls only that part. That way, the test will be still valid when/if systemd accepts the ordering fix patch.

@igo95862
Copy link
Collaborator

Thank you for implementing changes. I will try to review this next weekend. I want to verify how the other users of _dbus_iter_interfaces_meta will get affected like the parser helpers. Maybe it is better to have the reverse order only for the interface exports.

@igo95862 igo95862 merged commit c6a9d2f into python-sdbus:master Jun 21, 2025
4 checks passed
@igo95862
Copy link
Collaborator

I tested it a bit locally. Looks like controlling the iteration order is not required for now. I will add such option once it is needed.

Thank you for your work @arkq !

@arkq arkq deleted the reversed branch June 21, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants