python-expert
提升 Python 代码质量
Python 项目通常需要更强的正确性、类型和代码风格保障。此技能使用实用的 Python 最佳实践来指导实现和审查。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "python-expert" from https://skillstore.io/skills/shubhamsaboo-python-expert.md and its manifest at https://skillstore.io/api/skills/shubhamsaboo-python-expert/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“python-expert”。 审查这个工具模块的 Python 质量。
预期结果:
- 严重问题:一个函数使用了可变默认列表,这可能会在调用之间泄漏状态。
- 高优先级:多个公共函数缺少返回类型注解和清晰的错误行为说明。
- 中优先级:该模块需要为公共辅助函数使用更短的名称和更清晰的 docstring。
正在使用“python-expert”。 改进这个数据容器类。
预期结果:
- 建议:使用 dataclass,因为该类主要存储带类型的字段。
- 当对象不应更改时,添加显式字段类型、默认值和不可变性。
- 仅为 dataclasses 不会自动提供的行为保留自定义方法。
正在使用“python-expert”。 让这个文件处理脚本更安全。
预期结果:
- 为每个文件句柄使用上下文管理器,以便在发生错误后也能完成清理。
- 分别处理预期的解析异常和文件缺失异常。
- 为 empty files、invalid input 和 large input streams 添加测试。
安全审计
安全All static findings are false positives from Markdown examples and Python teaching snippets. No evidence found of command execution, secret access, file-system abuse, prompt injection, or malicious intent in the reviewed files.
风险因素
⚙️ 外部命令 (8)
📁 文件系统访问 (1)
🔑 环境变量 (1)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/shubhamsaboo-python-expert/audits/2?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/shubhamsaboo-python-expert?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/shubhamsaboo-python-expert?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/shubhamsaboo-python-expert/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/shubhamsaboo-python-expert.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
shubhamsaboo. (2026). python-expert security audit report (audit version 2) [Author version 1.0.0]. Skillstore. https://skillstore.io/skills/shubhamsaboo-python-expert/audits/2BibTeX 引用
@techreport{shubhamsaboo-shubhamsaboo-python-expert-2026,
author = {shubhamsaboo},
title = {python-expert security audit report (audit version 2)},
institution = {Skillstore},
year = {2026},
number = {2},
url = {https://skillstore.io/skills/shubhamsaboo-python-expert/audits/2},
note = {Author version 1.0.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "python-expert security audit report (audit version 2)"
version: "1.0.0"
type: report
authors:
- name: "shubhamsaboo"
date-released: "2026-07-07"
url: "https://skillstore.io/skills/shubhamsaboo-python-expert/audits/2"
identifiers:
- type: other
value: "skillstore:shubhamsaboo-python-expert:audit:2"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 中你能构建什么
审查 Pull Request
在合并前发现 Python 正确性、类型、错误处理、性能和文档问题。
重构脚本
通过更清晰的函数、更安全的资源处理和更好的风格改进现有脚本。
学习 Python 实践
通过简明示例和审查清单理解常见 Python 陷阱。
试试这些提示
审查我的 Python 代码,检查可变默认值、裸 except 子句、缺失的类型提示和不清晰的命名。用简单方式解释每个问题。
帮我通过类型提示、清晰的 docstring、输入验证和具体异常来改进这个 Python 函数接口。
在不改变行为的前提下,重构这个 Python 模块以提升可读性、数据容器、资源清理和性能。
执行面向发布的 Python 审查。优先关注正确性、错误处理、类型安全、资源清理、性能、测试和文档。
最佳实践
- 先处理正确性问题,再进行风格修改或性能调优。
- 使用具体异常,并清楚解释回退行为。
- 为其他用户会调用的公共函数添加类型提示和 docstring。
避免
- 不要为列表、字典或集合使用可变默认参数。
- 不要用裸 except 子句或静默 pass 语句隐藏错误。
- 在测量实际瓶颈之前,不要优化 Python 代码。
常见问题
这个技能能帮助做什么?
它能审查现有代码吗?
它会运行 Python 测试吗?
它对初学者有用吗?
它涵盖安全吗?
哪些工具支持它?
开发者详情
作者
shubhamsaboo许可证
MIT
作者版本
v1.0.0
Skillstore 修订
r1
引用
412e23e39ccd9729546286287b96bb41707397cf
维护新鲜度
2026/7/18
使用量
3 次下载 · 0 次浏览