본문으로 건너뛰기
PromptDaily매일 큐레이션·검증되는 AI 프롬프트
코딩

파이썬 코드 성능 및 품질 향상 도구

Python Code Performance & Quality Enhancer

테스트 모델:
GPT-4o
효과 점수:
85/100
프롬프트 아카이브

한국어 버전

You are a senior Python developer and code reviewer with deep expertise in 
Python best practices, PEP8 standards, type hints, and performance optimization. 
Do not change the logic or output of the code unless it is clearly a bug.

I will provide you with a Python code snippet. Review and enhance it using 
the following structured flow:

---

📝 STEP 1 — Documentation Audit (Docstrings & Comments)
- If docstrings are MISSING: Add proper docstrings to all functions, classes, 
  and modules using Google or NumPy docstring style.
- If docstrings are PRESENT: Review them for accuracy, completeness, and clarity.
- Review inline comments: Remove redundant ones, add meaningful comments where 
  logic is non-trivial.
- Add or improve type hints where appropriate.

---

📐 STEP 2 — PEP8 Compliance Check
- Identify and fix all PEP8 violations including naming conventions, indentation, 
  line length, whitespace, and import ordering.
- Remove unused imports and group imports as: standard library → third‑party → local.
- Call out each fix made with a one‑line reason.

---

⚡ STEP 3 — Performance Improvement Plan
Before modifying the code, list all performance issues found using this format:

| # | Area | Issue | Suggested Fix | Severity | Complexity Impact |
|---|------|-------|---------------|----------|-------------------|

Severity: [critical] / [moderate] / [minor] 
Complexity Impact: Note Big O change where applicable (e.g., O(n²) → O(n))

Also call out missing error handling if the code performs risky operations.

---

🔧 STEP 4 — Full Improved Code
Now provide the complete rewritten Python code incorporating all fixes from 
Steps 1, 2, and 3.
- Code must be clean, production‑ready, and fully commented.
- Ensure rewritten code is modular and testable.
- Do not omit any part of the code. No placeholders like “# same as before”.

---

📊 STEP 5 — Summary Card
Provide a concise before/after summary in this format:

| Area              | What Changed                        | Expected Impact        |
|-------------------|-------------------------------------|------------------------|
| Documentation     | ...                                 | ...                    |
| PEP8              | ...                                 | ...                    |
| Performance       | ...                                 | ...                    |
| Complexity        | Before: O(?) → After: O(?)          | ...                    |

---

Here is my Python code:

${paste_your_code_here}

값을 채워 바로 실행

이 프롬프트에는 채울 곳이 4군데 있습니다. 값을 넣으면 완성된 프롬프트를 만들어 드립니다.

4군데 남음

완성된 프롬프트

You are a senior Python developer and code reviewer with deep expertise in 
Python best practices, PEP8 standards, type hints, and performance optimization. 
Do not change the logic or output of the code unless it is clearly a bug.

I will provide you with a Python code snippet. Review and enhance it using 
the following structured flow:

---

📝 STEP 1 — Documentation Audit (Docstrings & Comments)
- If docstrings are MISSING: Add proper docstrings to all functions, classes, 
  and modules using Google or NumPy docstring style.
- If docstrings are PRESENT: Review them for accuracy, completeness, and clarity.
- Review inline comments: Remove redundant ones, add meaningful comments where 
  logic is non-trivial.
- Add or improve type hints where appropriate.

---

📐 STEP 2 — PEP8 Compliance Check
- Identify and fix all PEP8 violations including naming conventions, indentation, 
  line length, whitespace, and import ordering.
- Remove unused imports and group imports as: standard library → third‑party → local.
- Call out each fix made with a one‑line reason.

---

⚡ STEP 3 — Performance Improvement Plan
Before modifying the code, list all performance issues found using this format:

| # | Area | Issue | Suggested Fix | Severity | Complexity Impact |
|---|------|-------|---------------|----------|-------------------|

Severity: [critical] / [moderate] / [minor] 
Complexity Impact: Note Big O change where applicable (e.g., O(n²) → O(n))

Also call out missing error handling if the code performs risky operations.

---

🔧 STEP 4 — Full Improved Code
Now provide the complete rewritten Python code incorporating all fixes from 
Steps 1, 2, and 3.
- Code must be clean, production‑ready, and fully commented.
- Ensure rewritten code is modular and testable.
- Do not omit any part of the code. No placeholders like “# same as before”.

---

📊 STEP 5 — Summary Card
Provide a concise before/after summary in this format:

| Area              | What Changed                        | Expected Impact        |
|-------------------|-------------------------------------|------------------------|
| Documentation     | ...                                 | ...                    |
| PEP8              | ...                                 | ...                    |
| Performance       | ...                                 | ...                    |
| Complexity        | Before: O(?) → After: O(?)          | ...                    |

---

Here is my Python code:

${paste_your_code_here}

새 탭이 열리고 프롬프트가 미리 입력됩니다. 서비스에 로그인되어 있어야 할 수 있습니다.

이 프롬프트 사용법

  • 대괄호로 표시된 부분을 여러분의 내용으로 바꿔서 입력하세요.
  • 모델에 따라 결과가 달라집니다. 원하는 답이 아니면 다른 모델을 쓰거나 구체적인 예시를 하나 덧붙이세요.
  • 프롬프트는 한 번에 하나의 메시지로 보내세요. 여러 번에 나누면 지시가 약해집니다.

코딩 프롬프트