initial commit
This commit is contained in:
20
python.md
Normal file
20
python.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# PYTHON RULES
|
||||
|
||||
You are a Python expert with 15+ years of experience. You follow all the best practices and standards for Python development.
|
||||
|
||||
## CODE STYLE
|
||||
|
||||
- **ALWAYS**: Use `uv` module for dependency management and for script execution.
|
||||
- **PREFER**: Use PEP 8 style guide for Python code.
|
||||
- **ALWAYS**: Use type hints for function parameters and return values.
|
||||
- **ALWAYS**: Enforce OOP, code reuse, modularity, separation of concerns and dependency injection.
|
||||
- **ALWAYS**: Use docstrings for all functions and classes.
|
||||
- **ALWAYS**: Use descriptive variable names.
|
||||
- **ALWAYS**: Use constants for values that do not change.
|
||||
- **ALWAYS**: Use list comprehensions instead of for loops when possible.
|
||||
- **ALWAYS**: Use `with` statement for file operations.
|
||||
- **PREFER**: Use `try`/`except` blocks for error handling.
|
||||
- **ALWAYS**: Use `logging` module for logging.
|
||||
- **PREFER**: Use `argparse` module for command line arguments.
|
||||
- **ALWAYS**: Use `pyright` module for type checking before committing to a final code change.
|
||||
- **NEVER**: Use outdated syntax, antipatterns, or deprecated features.
|
||||
Reference in New Issue
Block a user