-
Notifications
You must be signed in to change notification settings - Fork 71
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
provides taggedvalue inheritance #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMish, but I don't see
- a changelog update
- documentation update
Also, is this a backwards-incompatible change (requiring a major version bump), a new feature (requiring a minor version bump), or a bugfix?
good, thanks.
done.
I ask for your support on that. IMHO it's a bugfix, no changes. The only backwards-incompatible could be if someone expects the current wrong behavior, where tag on a class don't inherits in a subclass... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(I'm not sure my review is worth much, given that I've no idea this API existed in zope.interface, despite using it for many years ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think of this change not as a simple bugfix more as a missing feature as you only had to write new code instead of changing existing one (besides in the tests.)
Coveralls seems to be broken in itself: it lists all files several times. |
There's a difference between overriding an inherited method (to fix behaviour) and adding a new method (to add behaviour), but merely looking at the diff is not enough to distinguish these two cases (which was why I asked). |
@mgedmin Right, I did not look deep enough into the code. I know and use the tagging features sporadically. The issue which is fixed here has never been a problem for me. |
@icemac @mgedmin thanks a lot for the reviews. |
This missing inheritance of tagged values always felt like a bug to me, even if one may argue its a missing feature. It is just not what one would expect. Also, it makes life harder than it should. 👍 for merging this. |
@mamico Feel free to merge the PR yourself to prove you signed the Contributor agreement. |
@mamico Do you need a release of |
FWIW, this turned out to be a breaking change for us. We apparently had code (in nti.externalization) that implicitly relied on tagged values not being inherited. There's code that examines classes in a module, and if they implement an interface that provides a particular tagged value, a utility is registered with a name from the value of that tag. With 4.7.0, we started registering duplicate utilities because we started finding classes that only implemented a derived interface. Simplified example: class IPublic(Interface):
taggedValue('tagged-value', 'public')
class IPrivate(IPublic):
pass
@implementer(IPublic)
class Public(object): pass
@implementer(IPrivate)
class PrivateImplementation(object): pass With 4.6, we'd register I think I can workaround this by calling (EDIT: Clarified some typos in the sample code.) |
provides query/get/list taggedvalue with subclass inheritance
fix: plone/plone.dexterity#57 and similar issues