Skip to content
Back to skills

Py

ASecurity

Write reliable Python avoiding mutable defaults, import traps, and common runtime surprises.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
toolspythongotesting

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill py --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Py?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Py
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-openclaw-skills-e6e815eb/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-openclaw-skills-e6e815eb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Python
slug: python
version: 1.0.1
description: Write reliable Python avoiding mutable defaults, import traps, and common runtime surprises.
metadata: {"clawdbot":{"emoji":"🐍","requires":{"bins":["python3"]},"os":["linux","darwin","win32"]}}
---

## Quick Reference

| Topic | File |
|-------|------|
| Dynamic typing, type hints, duck typing | `types.md` |
| List/dict/set gotchas, comprehensions | `collections.md` |
| Args/kwargs, closures, decorators, generators | `functions.md` |
| Inheritance, descriptors, metaclasses | `classes.md` |
| GIL, threading, asyncio, multiprocessing | `concurrency.md` |
| Circular imports, packages, __init__.py | `imports.md` |
| Pytest, mocking, fixtures | `testing.md` |

## Critical Rules

- `def f(items=[])` shares list across all calls β€” use `items=None` then `items = items or []`
- `is` checks identity, `==` checks equality β€” `"a" * 100 is "a" * 100` may be False
- Modifying list while iterating skips elements β€” iterate over copy: `for x in list(items):`
- GIL prevents true parallel Python threads β€” use multiprocessing for CPU-bound
- Bare `except:` catches `SystemExit` and `KeyboardInterrupt` β€” use `except Exception:`
- `UnboundLocalError` when assigning to outer scope variable β€” use `nonlocal` or `global`
- `open()` without context manager leaks handles β€” always use `with open():`
- Circular imports fail silently or partially β€” import inside function to break cycle
- `0.1 + 0.2 != 0.3` β€” floating point, use `decimal.Decimal` for money
- Generator exhausted after one iteration β€” can't reuse, recreate or use `itertools.tee`
- Class attributes with mutables shared across instances β€” define in `__init__` instead
- `__init__` is not constructor β€” `__new__` creates instance, `__init__` initializes
- Default encoding is platform-dependent β€” always specify `encoding='utf-8'`

Files in this skill

  • SKILL.md1.8 KB
  • _meta.json443 B
  • classes.md605 B
  • collections.md616 B
  • concurrency.md763 B
  • functions.md577 B
  • imports.md534 B
  • testing.md498 B
  • types.md505 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools β†’

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.