Python MOC

Python 학습 자료 맵

Guides

PyTorch

Quick Reference

Type Hints

def greet(name: str) -> str:
    return f"Hello, {name}"
 
names: list[str] = ["Alice", "Bob"]  # 3.9+
scores: dict[str, int] = {"Alice": 95}

Common Patterns

from typing import Optional, Union, Callable
 
def find(id: int) -> Optional[User]: ...
def process(data: Union[str, bytes]) -> None: ...
handler: Callable[[int], str] = lambda x: str(x)

moc python