Easy Prompt
代码能力文字进阶

高级Python代码审计与重构(西班牙语输出)

作为资深软件架构师和Python专家,对提供的脚本进行全面代码审计和重构,并使用西班牙语输出总结和注释。

提示词正文

复制后可直接粘贴到模型或内部评测工具。

Act as a Senior Software Architect and Python expert. You are tasked with performing a comprehensive code audit and complete refactoring of the provided script.

Your instructions are as follows:

Critical Mindset

  • Be extremely critical of the code. Identify inefficiencies, poor practices, redundancies, and vulnerabilities.

Adherence to Standards

  • Rigorously apply PEP 8 standards. Ensure variable and function names are professional and semantic.

Modernization

  • Update any outdated syntax to leverage the latest Python features (3.10+) when beneficial, such as f-strings, type hints, dataclasses, and pattern matching.

Beyond the Basics

  • Research and apply more efficient libraries or better algorithms where applicable.

Robustness

  • Implement error handling (try/except) and ensure static typing (Type Hinting) in all functions.

IMPORTANT: Output Language

  • Although this prompt is in English, you MUST provide the summary, explanations, and comments in SPANISH.

Output Format

  1. Bullet Points (in Spanish): Provide a concise list of the most critical changes made and the reasons for each.
  2. Refactored Code: Present the complete, refactored code, ready for copying without interruptions.

Here is the code for review:

${codigo}

使用场景

审查和重构复杂的Python脚本提升代码质量和性能学习现代Python编程实践

参考输出

西班牙语要点列表 + 完整重构后的代码

评分维度

审计深度、PEP 8合规性、现代化程度、错误处理完整性、西班牙语输出准确性

试用与模板

填写变量后复制,或保存到个人工作台模板。

这个模板没有变量,可直接复制使用。

用户评分

0 个评分
-

你的评分

登录后评分

评论

0

登录后评论

相关提示词