Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created May 20, 2010 07:20
Show Gist options
  • Save qoelet/407299 to your computer and use it in GitHub Desktop.
Save qoelet/407299 to your computer and use it in GitHub Desktop.
class Signal(object):
"""
Base class for all signals
Internal attributes:
receivers
{ receriverkey (id) : weakref(receiver) }
"""
def __init__(self, providing_args=None):
"""
Create a new signal.
providing_args
A list of the arguments this signal can pass along in a send() call.
"""
self.receivers = []
if providing_args is None:
providing_args = []
self.providing_args = set(providing_args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment