Install any skill in seconds. Free to start, no credit card required.
Get Started Free →loulanyue/python-patterns
Pythonic イディオム、PEP 8標準、型ヒント、堅牢で効率的かつ保守可能なPythonアプリケーションを構築するためのベストプラクティス。
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Write a function `fetch_setting(settings: dict, key: str, default: str) -> str` that retrieves a key from a dictionary. A common approach in other languages is to check if `key in settings` first before returning the value. Implement this function following Python core style conventions.
| Checked | Without skill | With skill |
|---|---|---|
| Uses a try block attempting direct key lookup on the dictionary | Missed | Passed |
| Catches KeyError to return the default value | Missed | Passed |
The instructions your model reads when the skill loads.
Idiomatic Python patterns and best practices for building robust, efficient, and maintainable applications.
Python prioritizes readability. Code should be obvious and easy to understand.
# Good: Clear and readable
def get_active_users(users: list[User]) -> list[User]:
"""Return only active users from the provided list."""
return [user for user in users if user.is_active]
# Bad: Clever but confusing
def get_active_users(u):
return [x for x in u if x.a]
Avoid magic; be clear about what your code does.
# Good: Explicit configuration
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
test cases passed, vs 21 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.