From: Gaƫtan de Menten Date: Sun, 7 Mar 2010 19:45:39 +0000 (+0100) Subject: - plug a minor ORM speed hit in Events (**kwargs). X-Git-Tag: rel_0_6beta2~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b83b380023064a89b2f9ffdd0afad4fa942bdc7;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - plug a minor ORM speed hit in Events (**kwargs). - added comment explaining some strange code --- diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index a51a94e5c9..eff7d65cbe 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