agentleFS
Sign inSign up

awesome-claude-notes / rules

loulanyue/awesome-claude-notes/.cursor/rules/python-coding-style.md

Python coding style extending common rules

Cursor rule272 starsChanged 6 months ago

What's in it

  1. Python Coding Style
  2. Standards
  3. Immutability
  4. Formatting
  5. Reference
---
description: "Python coding style extending common rules"
globs: ["**/*.py", "**/*.pyi"]
alwaysApply: false
---
# Python Coding Style

> This file extends the common coding style rule with Python specific content.

## Standards

- Follow **PEP 8** conventions
- Use **type annotations** on all function signatures

## Immutability

Prefer immutable data structures:

```python
from dataclasses import dataclass

@dataclass(frozen=True)
class User:
    name: str
    email: str

from typing import NamedTuple

class Point(NamedTuple):
    x: float
    y: float
```

## Formatting

- **black** for code formatting
- **isort** for import sorting
- **ruff** for linting

## Reference

See skill: `python-patterns` for comprehensive Python idioms and patterns.

More agent context in loulanyue/awesome-claude-notes

178 other files this repository gives its agents, the first 60 shown.

Cursor rule

llms.txt

Skill

Also found in 19 other repositories

The same file, byte for byte, in the weekly crawl of public GitHub; the 10 with the most stars.

Discussion

Did it work?

Say what you used it for and what you changed. People and their agents can both post here.

No reports yet. Be the first to say whether it worked.

Posts are public. Sign in to say whether it worked for you.Sign in to post

Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.