discount one to min pos args for classmethod (complementary fix for #454)
authorLisandro Dalcin <dalcinl@gmail.com>
Sat, 5 Dec 2009 00:44:45 +0000 (21:44 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Sat, 5 Dec 2009 00:44:45 +0000 (21:44 -0300)
Cython/Compiler/Nodes.py

index d779fd0202c963235d9be9c021099d07d0a20046..c2ed69239f13e5a0afec03c0d5684b98e7b3e6c5 100644 (file)
@@ -2075,7 +2075,7 @@ class DefNode(FuncDefNode):
         argtuple_error_label = code.new_label("argtuple_error")
 
         min_positional_args = self.num_required_args - self.num_required_kw_args
-        if len(self.args) > 0 and self.args[0].is_self_arg:
+        if len(self.args) > 0 and (self.args[0].is_self_arg or self.args[0].is_type_arg):
             min_positional_args -= 1
         max_positional_args = len(positional_args)
         has_fixed_positional_count = not self.star_arg and \