Pythonic 惯用法、PEP 8 标准、类型提示以及构建健壮、高效、可维护的 Python 应用程序的最佳实践。
65
48%
Does it follow best practices?
Impact
94%
1.17xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./docs/zh-CN/skills/python-patterns/SKILL.mdPython package structure and tooling configuration
src/ layout
100%
100%
tests/ at root
100%
100%
pyproject.toml present
100%
100%
black line-length 88
0%
100%
ruff configuration
100%
100%
mypy strict settings
100%
100%
pytest configuration
100%
100%
__all__ export list
100%
100%
Import ordering
100%
100%
Dataclass usage
100%
100%
dataclass field defaults
100%
100%
__post_init__ validation
100%
100%
Type hints on functions
100%
100%
No mutable defaults
100%
100%
Error handling patterns and generators
EAFP over LBYL
100%
100%
Custom exception base class
100%
100%
Custom exception subclasses
100%
100%
Specific exception catching
62%
100%
Exception chaining
0%
100%
Context manager usage
100%
100%
Custom context manager
100%
100%
Generator function
100%
100%
List comprehension use
100%
100%
String join over concatenation
100%
100%
Type hints present
75%
100%
No wildcard imports
100%
100%
Concurrency, type system, and performance patterns
ThreadPoolExecutor for I/O
0%
0%
ProcessPoolExecutor for CPU
100%
100%
asyncio.gather for async I/O
100%
100%
Protocol for duck typing
0%
100%
Python 3.9+ generic types
0%
100%
__slots__ usage
100%
100%
functools.wraps in decorators
100%
100%
isinstance over type()
100%
100%
None comparison with is
100%
100%
Generator expression for aggregation
100%
0%
Type hints on all functions
57%
100%
No explicit imports of List/Dict from typing
0%
100%
ae2cadd
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.