Hi again,
Im opening this PR due to the main issue I found when writing a `rpm.ver`
subclass in python: Trying to compare different subclass instances would raise
a `NotImplementedError` while it was supported on base class instances.
The reason behind that was that the `verObject_Check` macro checked for operand
types to be the same as `rpm.ver`. A way to overcome that, is checking their
types are subclasses of `rpm.ver`, or simply calling `PyObject_TypeCheck`.
Im proposing this patch only targeting the `rpm.ver` type as Im not
sure if such behavior was intended in the first place. In fact, most of the
python bindings seem to follow the same type check pattern. Moreover, although
not directly related to `rpm.ver` (but `rpm.ts`), I found a similar proposal
was made but not merged in #1600. In case you consider this to be valid
proposal and that it could be helpful for other python bindings, I could try to
provide a more general patch as well.
Thank you for the attention once again!
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2839
-- Commit Summary --
* Support rpmver-py comparison operator inheritance
-- File Changes --
M python/rpmver-py.h (2)
M tests/rpmpython.at (27)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/2839.patch
https://github.com/rpm-software-management/rpm/pull/2839.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2839
You are receiving this because you are subscribed to this thread.
Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint