Skip to content

Commit e5199fd

Browse files
committed
Specify min 2 max 3 arguments for other __get__ functions
1 parent 4ec2044 commit e5199fd

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/function/AbstractFunctionBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
33
* Copyright (c) 2014, Regents of the University of California
44
*
55
* All rights reserved.
@@ -79,7 +79,7 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
7979
return AbstractFunctionBuiltinsFactory.getFactories();
8080
}
8181

82-
@Builtin(name = __GET__, minNumOfPositionalArgs = 3)
82+
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
8383
@GenerateNodeFactory
8484
@SuppressWarnings("unused")
8585
public abstract static class GetNode extends PythonTernaryBuiltinNode {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/ClassmethodBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -78,7 +78,7 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
7878
return ClassmethodBuiltinsFactory.getFactories();
7979
}
8080

81-
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 4)
81+
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
8282
@GenerateNodeFactory
8383
abstract static class GetNode extends PythonBuiltinNode {
8484
@Child MakeMethodNode makeMethod = MakeMethodNode.create();

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/MethodBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
33
* Copyright (c) 2014, Regents of the University of California
44
*
55
* All rights reserved.
@@ -185,7 +185,7 @@ Object doGeneric(@SuppressWarnings("unused") Object obj) {
185185
}
186186
}
187187

188-
@Builtin(name = __GET__, minNumOfPositionalArgs = 3)
188+
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
189189
@GenerateNodeFactory
190190
public abstract static class GetNode extends PythonTernaryBuiltinNode {
191191
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/StaticmethodBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -64,7 +64,7 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
6464
return StaticmethodBuiltinsFactory.getFactories();
6565
}
6666

67-
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 4)
67+
@Builtin(name = __GET__, minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
6868
@GenerateNodeFactory
6969
abstract static class GetNode extends PythonBuiltinNode {
7070
@Specialization

graalpython/lib-graalpython/property.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -75,7 +75,7 @@ def __init__(self, fget=None, fset=None, fdel=None, doc=None, name=None):
7575
self.name = name
7676
self._owner = None
7777

78-
def __get__(self, instance, owner):
78+
def __get__(self, instance, owner=None):
7979
if self._owner is None:
8080
self._owner = owner
8181
if instance is None:

0 commit comments

Comments
 (0)