python-modern-performance-standards

Enforce Python 3.10+ coding standards with msgspec, mypy, anyio, and pytest.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill python-modern-performance-standards-kreuzberg-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-modern-performance-standards
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.codex/skills/python-modern-performance-standards
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill python-modern-performance-standards-kreuzberg-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces modern, high-performance, and robust coding standards for Python development, ensuring code is efficient, maintainable, and leverages the latest language features.

Core Features & Use Cases

  • Python 3.10+ Features: Utilizes match/case, union types, and structural pattern matching.
  • Performance Focus: Mandates msgspec for efficient serialization and slots=True for memory optimization.
  • Strict Typing: Enforces comprehensive type hints and mypy --strict checks.
  • Functional Programming: Promotes pure functions, immutability, and functional patterns.
  • Async Operations: Requires anyio and httpx for fully asynchronous I/O.
  • Testing: Mandates function-based tests with high coverage using pytest and a real PostgreSQL database.

Quick Start

Apply these modern Python performance standards to the provided codebase.

Frequently Asked Questions about python-modern-performance-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are modern Python performance standards for high-performance development?

Modern Python performance standards mandate functional-first patterns, msgspec for serialization, strict typing with mypy, full async operations using anyio, and function-based testing with pytest to ensure efficient and maintainable code.

How do I enforce strict typing and mypy checks in a Python 3.10+ codebase?

You enforce strict typing by applying comprehensive type hints and running mypy --strict checks. This standard ensures robust type safety by leveraging Python 3.10+ features like union types and structural pattern matching.

What's the best way to handle async I/O and serialization in modern Python?

The best way to handle async I/O and serialization is using anyio and httpx for fully asynchronous operations, alongside msgspec for efficient serialization. This combination maximizes I/O performance and robustness.

Does this Python coding standard require a specific testing setup with pytest?

Yes, this Python coding standard requires function-based tests with high coverage using pytest. It specifically mandates testing against a real PostgreSQL database to ensure robust functional validation.

Why use msgspec and slots=True for Python memory optimization?

Using msgspec for serialization and slots=True for classes optimizes memory usage and enforces immutability. These functional-first performance patterns ensure high efficiency in Python 3.10+ applications.

Can I use this standard with older Python versions or synchronous libraries?

No, this standard requires Python 3.10+ to utilize match/case statements and structural pattern matching. It also mandates fully asynchronous operations using anyio, making synchronous libraries incompatible.