diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-02 13:12:09 -0700 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-02 13:12:09 -0700 |
| commit | 7548aa8ffd46eb6e0f73730d1b2eb515ba581f95 (patch) | |
| tree | 963393779f4c8c33351ea605f708f8da7d9f70bf /django/dispatch | |
| parent | 65c4ac3b2434d1828cb76c9f4454fe64e81354ee (diff) | |
More attacking E302 violators
Diffstat (limited to 'django/dispatch')
| -rw-r--r-- | django/dispatch/saferef.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py index 5a5fd45c4b..c6fca2be7b 100644 --- a/django/dispatch/saferef.py +++ b/django/dispatch/saferef.py @@ -8,6 +8,7 @@ aren't handled by the core weakref module). import traceback import weakref + def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target @@ -34,6 +35,7 @@ def safeRef(target, onDelete = None): else: return weakref.ref(target) + class BoundMethodWeakref(object): """'Safe' and reusable weak references to instance methods @@ -186,6 +188,7 @@ class BoundMethodWeakref(object): return function.__get__(target) return None + class BoundNonDescriptorMethodWeakref(BoundMethodWeakref): """A specialized BoundMethodWeakref, for platforms where instance methods are not descriptors. @@ -246,6 +249,7 @@ class BoundNonDescriptorMethodWeakref(BoundMethodWeakref): return getattr(target, function.__name__) return None + def get_bound_method_weakref(target, onDelete): """Instantiates the appropiate BoundMethodWeakRef, depending on the details of the underlying class method implementation""" |
