ഡെവലപ്പർമാർക്ക് സെക്കൻഡുകൾക്കുള്ളിൽ ക്ലീൻ കോഡ് ഒപ്റ്റിമൈസേഷൻ നേടാനുള്ള ഡെവലപ്പർ പ്രോംപ്റ്റ്.
സങ്കീർണ്ണമായ പൈത്തൺ കോഡുകളുടെ സ്പീഡ് കൂട്ടാനും ടൈപ്പ് ആനോട്ടേഷൻ ചേർക്കാനും സഹായിക്കുന്ന പ്രോംപ്റ്റ്.
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.