| name | python |
| description | Python programming with type hints, async/await, decorators, and package management. Use for .py files and data science. |
Python
Modern Python development with type hints, async/await, and best practices.
When to Use
- Working with
.py files
- Building APIs with FastAPI/Django
- Data analysis with pandas/numpy
- Scripting and automation
Quick Start
from typing import Optional, List
def process_items(
items: list[str],
transform: Optional[callable] = None,
) -> list[str]:
if transform:
return [transform(item) for item in items]
return items
Core Concepts
Type Hints
from typing import TypeVar, Generic
from collections.abc import Callable, Iterator
def process_items() -> []:
transform:
[transform(item) item items]
items
T = TypeVar()
() -> T | :
items[] items