Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0bd9406

Browse filesBrowse files
committed
cursor(rules[dev-loop]) Sync with latest python loop
1 parent f800489 commit 0bd9406
Copy full SHA for 0bd9406

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed

‎.cursor/rules/dev-loop.mdc

Copy file name to clipboardExpand all lines: .cursor/rules/dev-loop.mdc
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: QA every edit
33
globs: *.py
4+
alwaysApply: true
45
---
56

67
# Development Process
@@ -167,3 +168,20 @@ For doctests in `src/**/*.py` files:
167168
2. **Preferred pytest patterns**:
168169
- Use `tmp_path` (pathlib.Path) fixture over Python's `tempfile`
169170
- Use `monkeypatch` fixture over `unittest.mock`
171+
172+
### Import Guidelines
173+
174+
1. **Prefer namespace imports**:
175+
- Import modules and access attributes through the namespace instead of importing specific symbols
176+
- Example: Use `import enum` and access `enum.Enum` instead of `from enum import Enum`
177+
- This applies to standard library modules like `pathlib`, `os`, and similar cases
178+
179+
2. **Standard aliases**:
180+
- For `typing` module, use `import typing as t`
181+
- Access typing elements via the namespace: `t.NamedTuple`, `t.TypedDict`, etc.
182+
- Note primitive types like unions can be done via `|` pipes and primitive types like list and dict can be done via `list` and `dict` directly.
183+
184+
3. **Benefits of namespace imports**:
185+
- Improves code readability by making the source of symbols clear
186+
- Reduces potential naming conflicts
187+
- Makes import statements more maintainable

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.