Python with 구문 type hint

Seungjun Lee·2023년 1월 30일
0

with 구문 사용시 type hint 적용 방법

x: str
with example() as x:
    [...]

or

with example() as x:
    x: str
    [...]

출처
https://stackoverflow.com/questions/60169996/does-a-with-statement-support-type-hinting

profile
개발자?

0개의 댓글