പൈത്തൺ കോഡ് റിഫാക്ടറിംഗ് & ഒപ്റ്റിമൈസേഷൻ പ്രോംപ്റ്റ് (Python Clean Code & Performance)

സന്തോഷ് കുമാർ എൻ
Last Updated: 26 August 2026, 11:57 AM

സങ്കീർണ്ണമായ പൈത്തൺ കോഡുകളുടെ സ്പീഡ് കൂട്ടാനും ടൈപ്പ് ആനോട്ടേഷൻ ചേർക്കാനും സഹായിക്കുന്ന പ്രോംപ്റ്റ്.

PROMPT SPECIFICATIONS

Platform: Claude 3.7 / ChatGPT 4o

Category: Coding & Software
Difficulty: Advanced
PROMPT TEMPLATE
You are a Principal Software Engineer and Python Architect.

Review and refactor the following Python code snippet according to PEP 8 standards, DRY principles, and optimal time/space complexity:

```python
[PASTE YOUR PYTHON CODE HERE]
```

Please provide:
1. Complexity Analysis: Current vs Optimized Big-O time and memory performance.
2. Security & Edge Case Audit: Potential runtime exceptions, memory leaks, or unhandled inputs.
3. Fully Refactored Code: Clean, typed (type hinting), documented with Google docstrings, and robust error handling.
4. Pytest Unit Tests: 3-5 comprehensive unit tests covering edge cases.

ഡെവലപ്പർമാർക്ക് സെക്കൻഡുകൾക്കുള്ളിൽ ക്ലീൻ കോഡ് ഒപ്റ്റിമൈസേഷൻ നേടാനുള്ള ഡെവലപ്പർ പ്രോംപ്റ്റ്.

LATEST FROM THIS SECTION

View All →