Files
AI/참고/ontocast-main/.cursor/rules/python-style.mdc

16 lines
541 B
Plaintext
Raw Normal View History

2026-05-12 19:40:31 +09:00
---
description: "Follow project style guidelines for Python code"
globs:
- "**/*.py"
alwaysApply: true
---
# Python Coding Rules
- Use python 3.12 conventions: use `type | None` instead of `Optional` etc
- Use type hints everywhere (PEP 484).
- Use snake_case for functions and variables, PascalCase for classes.
- Use `pydantic.BaseModel` for structured data, not dataclasses
- Avoid unused imports.
- Use `async`/`await` where appropriate.
- Always keep functions small and composable.
- Avoid using hasattr at all costs, it's not safe