summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-12-14 23:11:13 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-12-14 23:11:13 +0000
commit6c4ad36cc9004db1d9dffe28a95e3556d14e2c82 (patch)
tree9ef9b12c21fbcd0963da1332ac001d208f6a6f07 /lib/sqlalchemy/util.py
parentd73d0f420cc6beeb06f6f7e971f7b64b0a4adca0 (diff)
downloadsqlalchemy-6c4ad36cc9004db1d9dffe28a95e3556d14e2c82.tar.gz
- simplified _mapper_registry further. its now just a weakkeydict of mapper->True, stores
all mappers including non primaries, and is strictly used for the list of "to compile/dispose". - all global references are now weak referencing. if you del a mapped class and any dependent classes, its mapper and all dependencies fall out of scope. - attributes.py still had issues which were barely covered by tests. added way more tests (coverage.py still says 71%, doh) fixed things, took out unnecessary commit to states. attribute history is also asserted for ordering.
Diffstat (limited to 'lib/sqlalchemy/util.py')
-rw-r--r--lib/sqlalchemy/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py
index 3e26217c9..463d4b8af 100644
--- a/lib/sqlalchemy/util.py
+++ b/lib/sqlalchemy/util.py
@@ -4,7 +4,7 @@
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-import itertools, sys, warnings, sets
+import itertools, sys, warnings, sets, weakref
import __builtin__
from sqlalchemy import exceptions, logging
@@ -113,7 +113,7 @@ def flatten_iterator(x):
yield elem
class ArgSingleton(type):
- instances = {}
+ instances = weakref.WeakValueDictionary()
def dispose(cls):
for key in list(ArgSingleton.instances):