[[topics]]
topic = "linux_perf_support"
title = "Linux Perf 支持"
file = "01_新特性/LinuxPerf支持.md"
when_to_use = "在 Linux 上进行性能分析和调优时"
keywords = ["Linux", "perf", "性能分析", "profiling"]
[[topics]]
topic = "pep669_monitoring"
title = "PEP 669 - 低影响监控 API"
file = "01_新特性/PEP669_监控API.md"
when_to_use = "需要实现性能分析、调试工具或代码覆盖率工具时"
keywords = ["PEP 669", "监控", "性能分析", "调试", "sys.monitoring"]
[[topics]]
topic = "pep684_subinterpreters"
title = "PEP 684 - 独立子解释器"
file = "01_新特性/PEP684_子解释器.md"
when_to_use = "需要真正的并行 Python 执行或代码隔离时"
keywords = ["PEP 684", "子解释器", "GIL", "并行", "隔离"]
[[topics]]
topic = "pep695_generics"
title = "PEP 695 - 改进的泛型语法"
file = "01_新特性/PEP695_泛型语法.md"
when_to_use = "需要定义泛型类或泛型函数时,使用 Python 3.12 的新语法"
keywords = ["PEP 695", "泛型", "Generic", "TypeVar", "type parameters", "类型参数"]
[[topics]]
topic = "pep698_override"
title = "PEP 698 - Override 装饰器"
file = "01_新特性/PEP698_Override装饰器.md"
when_to_use = "在子类中重写父类方法时,使用 @override 装饰器确保正确性"
keywords = ["PEP 698", "override", "继承", "方法重写", "装饰器", "typing"]
[[topics]]
topic = "pep701_fstring"
title = "PEP 701 - F-String 增强"
file = "01_新特性/PEP701_FString增强.md"
when_to_use = "使用 f-string 格式化字符串时,了解 Python 3.12 的新特性和增强功能"
keywords = ["PEP 701", "f-string", "格式化字符串", "字符串插值", "性能优化"]
[[topics]]
topic = "py312_performance"
title = "Python 3.12 性能改进"
file = "01_新特性/性能改进.md"
when_to_use = "了解 Python 3.12 的性能提升和优化建议"
keywords = ["性能", "PEP 709", "推导式", "asyncio", "优化"]
[[topics]]
topic = "py312_error_messages"
title = "Python 3.12 改进的错误消息"
file = "01_新特性/改进的错误消息.md"
when_to_use = "调试代码和理解错误信息时"
keywords = ["错误消息", "调试", "异常", "回溯"]
[[topics]]
topic = "pyproject_toml"
title = "pyproject.toml 配置指南"
file = "02_项目结构/pyproject.toml配置.md"
when_to_use = "配置项目元数据、依赖和构建系统时"
keywords = ["pyproject.toml", "配置", "PEP 518", "项目元数据"]
[[topics]]
topic = "naming_conventions"
title = "Python 命名约定"
file = "02_项目结构/命名约定.md"
when_to_use = "命名变量、函数、类和模块时"
keywords = ["命名", "PEP 8", "风格指南", "代码规范"]
[[topics]]
topic = "flat_layout"
title = "扁平布局 vs Src 布局"
file = "02_项目结构/扁平布局.md"
when_to_use = "组织 Python 项目目录结构时"
keywords = ["项目结构", "扁平布局", "src layout", "目录组织"]
[[topics]]
topic = "special_files"
title = "Python 特殊文件说明"
file = "02_项目结构/特殊文件.md"
when_to_use = "了解 Python 项目中特殊文件的作用"
keywords = ["__init__.py", "__main__.py", "py.typed", "特殊文件"]
[[topics]]
topic = "directory_organization"
title = "目录组织原则"
file = "02_项目结构/目录组织原则.md"
when_to_use = "规划项目目录结构和模块组织时"
keywords = ["目录结构", "模块化", "包管理", "项目组织"]
[[topics]]
topic = "uv_intro"
title = "UV - 极速 Python 包管理器"
file = "03_依赖管理/UV简介.md"
when_to_use = "需要快速的包管理和虚拟环境管理工具时"
keywords = ["uv", "包管理", "pip", "虚拟环境"]
[[topics]]
topic = "uv_advanced"
title = "UV 高级功能"
file = "03_依赖管理/UV高级功能.md"
when_to_use = "深入使用 uv 的高级特性和工作流时"
keywords = ["uv", "依赖锁定", "工作区", "高级功能"]
[[topics]]
topic = "venv_best_practices"
title = "虚拟环境最佳实践"
file = "03_依赖管理/虚拟环境最佳实践.md"
when_to_use = "创建和管理 Python 虚拟环境时"
keywords = ["虚拟环境", "venv", "隔离", "依赖管理"]
[[topics]]
topic = "basedpyright_config"
title = "Basedpyright 配置"
file = "04_类型提示/Basedpyright配置.md"
when_to_use = "配置 Basedpyright 类型检查器时"
keywords = ["basedpyright", "类型检查", "配置", "pyright"]
[[topics]]
topic = "basic_type_hints"
title = "基本类型提示"
file = "04_类型提示/基本类型提示.md"
when_to_use = "为 Python 代码添加类型注解时"
keywords = ["类型提示", "typing", "类型注解", "静态类型"]
[[topics]]
topic = "advanced_type_hints"
title = "高级类型提示"
file = "04_类型提示/高级类型提示.md"
when_to_use = "使用泛型、Protocol 等高级类型特性时"
keywords = ["泛型", "Protocol", "TypeVar", "高级类型"]
[[topics]]
topic = "pre_commit_hooks"
title = "Pre-commit 钩子配置"
file = "05_代码质量/PreCommit钩子.md"
when_to_use = "设置 Git pre-commit 钩子自动化代码检查时"
keywords = ["pre-commit", "git hooks", "自动化", "代码质量"]
[[topics]]
topic = "ruff_intro"
title = "Ruff - 极速 Python Linter"
file = "05_代码质量/Ruff简介.md"
when_to_use = "需要快速代码检查和格式化工具时"
keywords = ["ruff", "linter", "formatter", "代码质量"]
[[topics]]
topic = "ruff_config"
title = "Ruff 配置指南"
file = "05_代码质量/Ruff配置.md"
when_to_use = "配置 Ruff 的规则和行为时"
keywords = ["ruff", "配置", "规则", "代码风格"]
[[topics]]
topic = "pytest_fixtures"
title = "Pytest Fixtures 使用"
file = "06_测试/Fixtures使用.md"
when_to_use = "需要设置测试夹具和共享测试数据时"
keywords = ["fixtures", "pytest", "测试数据", "setUp"]
[[topics]]
topic = "pytest_intro"
title = "Pytest 简介"
file = "06_测试/Pytest简介.md"
when_to_use = "编写 Python 单元测试和集成测试时"
keywords = ["pytest", "测试", "unittest", "TDD"]
[[topics]]
topic = "parametrized_tests"
title = "参数化测试"
file = "06_测试/参数化测试.md"
when_to_use = "需要用不同输入运行相同测试逻辑时"
keywords = ["参数化", "pytest.mark.parametrize", "数据驱动测试"]
[[topics]]
topic = "asyncio_basics"
title = "Asyncio 基础"
file = "07_异步编程/Asyncio基础.md"
when_to_use = "编写异步 I/O 代码时"
keywords = ["asyncio", "async", "await", "协程", "异步IO"]
[[topics]]
topic = "worker_pool"
title = "Worker Pool 模式"
file = "07_异步编程/WorkerPool模式.md"
when_to_use = "需要并发处理多个任务时"
keywords = ["worker pool", "并发", "任务队列", "异步"]
[[topics]]
topic = "profiling_tools"
title = "Python 性能分析工具"
file = "08_性能优化/性能分析工具.md"
when_to_use = "定位性能瓶颈和优化代码时"
keywords = ["性能分析", "profiling", "cProfile", "优化"]
[[topics]]
topic = "optimization_techniques"
title = "Python 通用优化技术"
file = "08_性能优化/通用优化技术.md"
when_to_use = "优化 Python 代码性能时"
keywords = ["优化", "性能", "算法", "数据结构"]
[[topics]]
topic = "owasp_injection"
title = "OWASP - 注入攻击防护"
file = "09_安全/OWASP01_注入攻击.md"
when_to_use = "处理用户输入和数据库查询时"
keywords = ["OWASP", "注入攻击", "SQL注入", "安全"]
[[topics]]
topic = "owasp_auth"
title = "OWASP - 破损的认证防护"
file = "09_安全/OWASP02_破损的认证.md"
when_to_use = "实现用户认证和会话管理时"
keywords = ["OWASP", "认证", "会话管理", "安全"]
[[topics]]
topic = "owasp_sensitive_data"
title = "OWASP - 敏感数据暴露防护"
file = "09_安全/OWASP03_敏感数据暴露.md"
when_to_use = "处理敏感数据和加密时"
keywords = ["OWASP", "敏感数据", "加密", "安全"]
[[topics]]
topic = "example_topic"
title = "示例主题标题"
file = "示例_Front_Matter模板.md"
when_to_use = "当你需要使用这个功能时"
keywords = ["关键词1", "关键词2", "关键词3"]