]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
removed init_attr() call, which has shown to not increase performance
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 15 Aug 2007 01:25:13 +0000 (01:25 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 15 Aug 2007 01:25:13 +0000 (01:25 +0000)
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/mapper.py

index 6218371e0a79f4699671164806aa5ac161556773..c9dfc7fce3e02a0a2b13c2bda6e7e51b892a542a 100644 (file)
@@ -708,17 +708,6 @@ class AttributeManager(object):
                 return True
         return object._state.get('modified', False)
 
-    def init_attr(self, obj):
-        """Sets up the __sa_attr_state dictionary on the given instance.
-
-        This dictionary is automatically created when the `_state`
-        attribute of the class is first accessed, but calling it here
-        will save a single throw of an ``AttributeError`` that occurs
-        in that creation step.
-        """
-
-        setattr(obj, '_%s__sa_attr_state' % obj.__class__.__name__, {})
-
     def get_history(self, obj, key, **kwargs):
         """Return a new ``AttributeHistory`` object for the given
         attribute on the given object.
index 9608c0f1cb667bc97aa331728697b54a1636defe..3870852d2aca20c9a8ec92c768a5a897140fca3c 100644 (file)
@@ -1467,10 +1467,6 @@ class Mapper(object):
         obj = self.class_.__new__(self.class_)
         obj._entity_name = self.entity_name
 
-        # this gets the AttributeManager to do some pre-initialization,
-        # in order to save on KeyErrors later on
-        attribute_manager.init_attr(obj)
-
         return obj
 
     def _deferred_inheritance_condition(self, needs_tables):