You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ChocoPy/pa2-tests/core/bad_class_method_override.py

34 lines
548 B

class A(object):
def foo(self:"A", x:int) -> int:
return x
def bar(self:"A", x:int) -> int:
return x
def baz(self:"A", x:int) -> int:
return x
def qux(self:"A", x:int) -> int:
return x
class B(A):
# OK override
def foo(self:"B", x:int) -> int:
return 0
# Bad override
def bar(self:"B") -> int:
return 0
# Bad override
def baz(self:"B", x:int) -> bool:
return True
# Bad override
def qux(self:"B", x:bool) -> int:
return 0
B()