diff options
author | Gaëtan de Menten <ged@openhex.org> | 2010-03-07 20:45:39 +0100 |
---|---|---|
committer | Gaëtan de Menten <ged@openhex.org> | 2010-03-07 20:45:39 +0100 |
commit | 2b83b380023064a89b2f9ffdd0afad4fa942bdc7 (patch) | |
tree | 899cbdc6ce8457f87f331e8c2e5110b71f80b7c1 | |
parent | 6f1425d04ace2bbe41ae426c726bfd81f26b6174 (diff) | |
download | sqlalchemy-2b83b380023064a89b2f9ffdd0afad4fa942bdc7.tar.gz |
- plug a minor ORM speed hit in Events (**kwargs).
- added comment explaining some strange code
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index a51a94e5c..eff7d65cb 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -883,14 +883,16 @@ class GenericBackrefExtension(interfaces.AttributeExtension): class Events(object): def __init__(self): self.original_init = object.__init__ + # Initialize to tuples instead of lists to minimize the memory + # footprint self.on_init = () self.on_init_failure = () self.on_load = () self.on_resurrect = () - def run(self, event, *args, **kwargs): + def run(self, event, *args): for fn in getattr(self, event): - fn(*args, **kwargs) + fn(*args) def add_listener(self, event, listener): # not thread safe... problem? mb: nope |