instance issue with param static analysis

This commit is contained in:
Dave Halter
2014-06-09 01:59:54 +02:00
parent 920eb3b06a
commit 496671966b
2 changed files with 17 additions and 3 deletions

View File

@@ -55,3 +55,19 @@ default(1, 2, 3)
default(1, 2, 3, 4)
default(x=1)
# -----------------
# class arguments
# -----------------
class Instance():
def __init__(self, foo):
self.foo = foo
Instance(1).foo
Instance(foo=1).foo
#! 12 type-error-too-many-arguments
Instance(1, 2).foo
#! 8 type-error-too-few-arguments
Instance().foo