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

pyramid.events.subscriber with empty events list does not behave as documented #386

Closed
xrotwang opened this issue Jan 3, 2012 · 2 comments
Labels

Comments

@xrotwang
Copy link

xrotwang commented Jan 3, 2012

This may be just a documentation bug, but reading
"When the subscriber decorator is used without passing an arguments, the function it decorates is called for every event sent"
made me expect something that did not happen:

from pyramid.events import subscriber, NewRequest
from pyramid.config import Configurator

@subscriber()
def mysubscriber(event):
    print event

@subscriber(NewRequest)
def s(event):
    print event

if __name__ == "__main__":
    from waitress import serve
    config = Configurator()
    config.scan(__name__)
    serve(config.make_wsgi_app())

upon requesting http://localhost:8080 subscriber s will get notified, but mysubscriber won't.

@mmerickel
Copy link
Member

confirmed, @mcdonc will have to answer whether it's a docs bug or implementation bug. There are no unit test for this case that I can find.

@mcdonc mcdonc closed this as completed in 52a948e Jan 3, 2012
@mcdonc
Copy link
Member

mcdonc commented Jan 3, 2012

Thank you!

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

No branches or pull requests

3 participants