From 2b83b380023064a89b2f9ffdd0afad4fa942bdc7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ga=C3=ABtan=20de=20Menten?= Date: Sun, 7 Mar 2010 20:45:39 +0100 Subject: [PATCH] - plug a minor ORM speed hit in Events (**kwargs). - added comment explaining some strange code --- lib/sqlalchemy/orm/attributes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.47.3