facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.

Home Page:https://trycinder.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static Python allows passing too many arguments to `__init__`

LuKuangChen opened this issue · comments

commented

What version of Static Python are you using?

4f1b313
2021-07-26

What program did you run?

# constructor_args_static.py

class Person:
    def __init__(self, name, age):
        pass

def main():
    p1 = Person('Alice', 21, False)
    return p1

What happened?

The program terminates without errors.

What should have happened?

We expected a compile-time error because the Person constructor (__init__) accepts only 2 arguments, but was given 3.

Fixed with a6a0dcb