Backport of weakref.WeakSet and tests from Python 3.

This commit is contained in:
Michael Foord 2010-03-29 20:04:23 +00:00
parent b8d688cd7c
commit e6410c536c
6 changed files with 602 additions and 1 deletions

View file

@ -20,6 +20,8 @@ from _weakref import (
ProxyType,
ReferenceType)
from _weakrefset import WeakSet
from exceptions import ReferenceError
@ -27,7 +29,7 @@ ProxyTypes = (ProxyType, CallableProxyType)
__all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",
"WeakKeyDictionary", "ReferenceError", "ReferenceType", "ProxyType",
"CallableProxyType", "ProxyTypes", "WeakValueDictionary"]
"CallableProxyType", "ProxyTypes", "WeakValueDictionary", 'WeakSet']
class WeakValueDictionary(UserDict.UserDict):