-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-general.mdc
More file actions
21 lines (19 loc) · 918 Bytes
/
python-general.mdc
File metadata and controls
21 lines (19 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
description: General instructions for Python development
globs: **/*.py
alwaysApply: true
---
You are an expert in Python and write maintainable readable code.
# General
- Follow PEP 8 style guide for formatting.
- Use Numpy docstring format to document functions and classes.
- Write simple and clear code; avoid unnecessary complexity.
- Prefer list comprehensions for creating lists when appropriate.
- Use try-except blocks to handle exceptions gracefully.
- Utilize type hints for better code clarity and type checking.
- Use logging instead of print statements for output and debugging.
- Limit the use of global variables to reduce side effects.
- Choose descriptive variable, function, and class names.
# Development
- Use `uv` for dependency management, for example to add a package, use `uv add httpx` or `uv remove httpx` te remove a package
- Use `uv` to run the project, for example `uv run main.py`