mirror of
https://github.com/mtshiba/pylyzer.git
synced 2025-07-08 01:54:59 +00:00
25 lines
349 B
Python
25 lines
349 B
Python
x = 1
|
|
x + "a" # OK, because x: Any
|
|
|
|
def f(x, y):
|
|
return x + y
|
|
|
|
class C:
|
|
y = 1
|
|
def __init__(self, x):
|
|
self.x = x
|
|
def f(self, x):
|
|
return self.x + x
|
|
|
|
print(f(1, 2)) # OK
|
|
print(f("a", "b")) # ERR*2
|
|
c = C(1)
|
|
print(c.f(2)) # OK
|
|
print(c.f("a")) # ERR
|
|
_ = C("a") # ERR
|
|
|
|
def g(x):
|
|
pass
|
|
|
|
print(g(c)) # OK
|
|
print(g(1)) # ERR
|