mirror of
https://github.com/mtshiba/pylyzer.git
synced 2025-07-07 17:45:00 +00:00
20 lines
344 B
Python
20 lines
344 B
Python
def f(x: int | None):
|
|
x + 1 # ERR
|
|
if x != None:
|
|
print(x + 1) # OK
|
|
if isinstance(x, int):
|
|
print(x + 1) # OK
|
|
return None
|
|
|
|
f(1)
|
|
|
|
from typing import Optional
|
|
|
|
x: Optional[int] = None
|
|
if x is not None:
|
|
x += 1
|
|
|
|
def sb(s: str | bytes) -> None:
|
|
if not isinstance(s, str):
|
|
str(s, "ascii")
|
|
return None
|