1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Use classmethod as a decorator.

This commit is contained in:
xuxiang
2013-11-20 10:02:30 +08:00
committed by Simon Charette
parent 73b3c257e3
commit 4cfe6ba6a3
4 changed files with 5 additions and 5 deletions

View File

@@ -135,6 +135,7 @@ class BoundMethodWeakref(object):
self.selfName = str(target.__self__)
self.funcName = str(target.__func__.__name__)
@classmethod
def calculateKey(cls, target):
"""Calculate the reference key for this reference
@@ -142,7 +143,6 @@ class BoundMethodWeakref(object):
target object and the target function respectively.
"""
return (id(target.__self__), id(target.__func__))
calculateKey = classmethod(calculateKey)
def __str__(self):
"""Give a friendly representation of the object"""