Pylons/pyramid — Issue #386: pyramid.events.subscriber with empty events list does not behave as documented
Author: xrotwang
Created: 2012-01-03 08:39:44+00:00
State: open

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('bug')
serve(config.make_wsgi_app())

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