Leon the start point

PostsAbout

4.9.8. Function Annotations

2025년 12월 15일1 min read

  • official_ref

https://docs.python.org/3/tutorial/controlflow.html#function-annotations

python 함수를 선언할 때 인자에 타입을 명시하거나 return하는 타입을 기록하는 것을 말함

def f(ham: str, eggs: str = 'eggs') -> str:
    return ham + ' and ' + eggs
    print("Annotations:", f.__annotations__)
    print("Arguments:", ham, eggs)

← python 3.14으로


그래프 뷰

  • python 3.14

Created with Quartz v4.5.2 © 2026

  • GitHub
  • Discord Community