프롬프트 도감 › No.1971
파이썬 코드 꼼꼼 점검
Senior Python Code Audit
파이썬 코드를 아주 비판적으로 살펴보고 최신 문법과 오류 처리를 넣어 다시 써 줘요. 바뀐 핵심 이유와 완성된 코드를 함께 보여 줘요.
이럴 때 코드 리뷰, 오래된 코드 새로 고치기, 코드 공부
도구 ChatGPT · Claude · Gemini
프롬프트
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}팁
- 마지막 코드 칸에 점검할 코드를 붙여 넣어요
- 설명 언어는 한국어로 바꿔 달라고 해요
출처
권리: CC0 (f/prompts.chat). 자유 사용. 기여자: [email protected].