Permalink
Browse files

Merge pull request #815 from scooter-dangle/Proc#arity-with-default-args

Calculate Proc#arity the same way as Method#arity
  • Loading branch information...
alex committed Jul 31, 2013
2 parents 31f9893 + 5791200 commit 45ab01988626d6c28749d2821d084743550e24f4
Showing with 1 addition and 5 deletions.
  1. +0 −4 spec/tags/core/proc/arity_tags.txt
  2. +1 −1 topaz/objects/procobject.py
@@ -1,5 +1 @@
fails:Proc#arity returns 1 for a block taking |a, | arguments
fails:Proc#arity returns -1 for a lambda taking one optional argument
fails:Proc#arity returns -2 for a lambda taking |a, b = 0| argument
fails:Proc#arity returns -2 for a lambda taking |a, b = 0, c = 0| argument
fails:Proc#arity returns -2 for a lambda taking |(a, b), c = 0| argument
@@ -63,7 +63,7 @@ def method_lambda(self, space):

@classdef.method("arity")
def method_arity(self, space):
return space.newint(self.bytecode.arity())
return space.newint(self.bytecode.arity(negative_defaults=self.is_lambda))

@classdef.method("binding")
def method_binding(self, space):

0 comments on commit 45ab019

Please sign in to comment.