Skip to content
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

Decorator for installables #77

Closed
mithrandi opened this issue Apr 19, 2017 · 4 comments
Closed

Decorator for installables #77

mithrandi opened this issue Apr 19, 2017 · 4 comments

Comments

@mithrandi
Copy link
Contributor

mithrandi commented Apr 19, 2017

Something like this:

@empowers(IFoo)
class MyPowerup(Item):
    …

which would be equivalent to:

@implementer(IFoo)
class MyPowerup(Item):
    powerupInterfaces = [IFoo]

The main motivation for this is that it makes no sense to have an interface in powerupInterfaces that you do not implement. Note that you can still implement interfaces that you don't power up for:

@implementer(INotPowerupInterface)
@empowers(IFoo)
class MyPowerup(Item):
    …

works fine.

@mithrandi
Copy link
Contributor Author

Any thoughts on this?

@mithrandi
Copy link
Contributor Author

Alternative naming suggestions wanted: empowers is the wrong tense, but empowerer is a bit awkward.

@ldanielburr
Copy link
Contributor

I think "@bestows" might work. You want to be able to say that this class provides the following powerup, but "provides" is already a term with a specific meaning in zope.interface.

Some other options:
"@bequeathes"
"@confers"
"@ImpArts"
"@awards"

@ldanielburr
Copy link
Contributor

ldanielburr commented Aug 3, 2018

Looking at this ticket again, I think I'd call it empowerment. empowerment(IFoo) reads sensibly, at least to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants