Skip to content

Commit 455bb78

Browse files
committed
Make 'classmethod' a builtin method for better inlining.
1 parent abd10d6 commit 455bb78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graalpython/lib-graalpython/classmethod.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ class classmethod(object):
4343
def __init__(self, func):
4444
self.__func__ = func
4545

46-
@__builtin__
47-
def __get__(self, instance, owner=None):
46+
def __get__(self, obj, instance=None, owner=None):
4847
if owner is None:
49-
return classmethod.method(type(instance), self.__func__)
48+
return classmethod.method(type(instance), obj.__func__)
5049
else:
51-
return classmethod.method(owner, self.__func__)
50+
return classmethod.method(owner, obj.__func__)
5251

5352

5453
classmethod.method = type(classmethod(None).__init__)
54+
classmethod.__get__ = __builtin__(classmethod.__get__)

0 commit comments

Comments
 (0)