Skip to content

Commit e907f81

Browse files
committed
ai(rules[AGENTS]): Clarify namespace imports for stdlib only
1 parent 3826ef9 commit e907f81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ Key highlights:
210210

211211
### Imports
212212

213-
- **Use namespace imports**: `import enum` instead of `from enum import Enum`
213+
- **Use namespace imports for standard library modules**: `import enum` instead of `from enum import Enum`
214214
- **Exception**: `dataclasses` module may use `from dataclasses import dataclass, field` for cleaner decorator syntax
215+
- This rule applies to Python standard library only; third-party packages may use `from X import Y`
215216
- **For typing**, use `import typing as t` and access via namespace: `t.NamedTuple`, etc.
216217
- **Use `from __future__ import annotations`** at the top of all Python files
217218

0 commit comments

Comments
 (0)