Commits

Mike Bayer  committed 369f5fe

- use our new Cls.memoized_name._reset(self) method in place of all those __dict__.pop(),
remove reset_memoized

  • Participants
  • Parent commits d9c4b40

Comments (0)

Files changed (6)

File lib/sqlalchemy/orm/state.py

 
         self.committed_state.clear()
 
-        self.__dict__.pop('_pending_mutations', None)
+        InstanceState._pending_mutations._reset(self)
 
         # clear out 'parents' collection.  not
         # entirely clear how we can best determine
         # which to remove, or not.
-        self.__dict__.pop('parents', None)
+        InstanceState.parents._reset(self)
 
         for key in self.manager:
             impl = self.manager[key].impl
 
         for state, dict_ in iter:
             state.committed_state.clear()
-            state.__dict__.pop('_pending_mutations', None)
+            InstanceState._pending_mutations._reset(state)
 
             callables = state.callables
             for key in list(callables):

File lib/sqlalchemy/sql/expression.py

         """
         c = self.__class__.__new__(self.__class__)
         c.__dict__ = self.__dict__.copy()
-        c.__dict__.pop('_cloned_set', None)
-        c.__dict__.pop('comparator', None)
+        ClauseElement._cloned_set._reset(c)
+        ColumnElement.comparator._reset(c)
 
         # this is a marker that helps to "equate" clauses to each other
         # when a Select returns its list of FROM clauses.  the cloning
             # pop out memoized proxy_set as this
             # operation may very well be occurring
             # in a _make_proxy operation
-            value.__dict__.pop('proxy_set', None)
+            ColumnElement.proxy_set._reset(value)
         self._all_cols.add(value)
         self._data[key] = value
 
     def _copy_internals(self, clone=_clone, **kw):
         self.clause_expr = clone(self.clause_expr, **kw)
         self._reset_exported()
-        util.reset_memoized(self, 'clauses')
+        FunctionElement.clauses._reset(self)
 
     def select(self):
         """Produce a :func:`~.expression.select` construct

File lib/sqlalchemy/sql/util.py

             element.c
 
         self.__dict__ = element.__dict__.copy()
-        self.__dict__.pop('comparator', None)
+        expression.ColumnElement.comparator._reset(self)
         self.__element = element
         self._annotations = values
 
     def _with_annotations(self, values):
         clone = self.__class__.__new__(self.__class__)
         clone.__dict__ = self.__dict__.copy()
-        clone.__dict__.pop('comparator', None)
+        expression.ColumnElement.comparator._reset(self)
         clone._annotations = values
         return clone
 

File lib/sqlalchemy/util/__init__.py

     getargspec_init, format_argspec_init, format_argspec_plus, \
     get_func_kwargs, get_cls_kwargs, decorator, as_interface, \
     memoized_property, memoized_instancemethod, \
-    reset_memoized, group_expirable_memoized_property, importlater, \
+    group_expirable_memoized_property, importlater, \
     monkeypatch_proxied_specials, asbool, bool_or_str, coerce_kw_type,\
     duck_type_collection, assert_arg_type, symbol, dictlike_iteritems,\
     classproperty, set_creation_order, warn_exception, warn, NoneType,\

File lib/sqlalchemy/util/langhelpers.py

         oneshot.__doc__ = self.__doc__
         return oneshot
 
-def reset_memoized(instance, name):
-    instance.__dict__.pop(name, None)
-
 
 class group_expirable_memoized_property(object):
     """A family of @memoized_properties that can be expired in tandem."""

File test/lib/profiles.txt

 
 # TEST: test.aaa_profiling.test_orm.MergeTest.test_merge_no_load
 
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.5_sqlite_pysqlite_nocextensions 106,20
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.6_sqlite_pysqlite_nocextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_mysql_mysqldb_cextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_mysql_mysqldb_nocextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_postgresql_psycopg2_cextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_postgresql_psycopg2_nocextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_sqlite_pysqlite_cextensions 98,16
-test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_sqlite_pysqlite_nocextensions 98,16
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.5_sqlite_pysqlite_nocextensions 108,22
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.6_sqlite_pysqlite_nocextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_mysql_mysqldb_cextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_mysql_mysqldb_nocextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_postgresql_psycopg2_cextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_postgresql_psycopg2_nocextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_sqlite_pysqlite_cextensions 100,18
+test.aaa_profiling.test_orm.MergeTest.test_merge_no_load 2.7_sqlite_pysqlite_nocextensions 100,18
 
 # TEST: test.aaa_profiling.test_pool.QueuePoolTest.test_first_connect