Refactor a Messy Python Function
Overview
Refactor a messy Python function while preserving behavior.
Use cases
Prompt
Copied 0
Refactor this messy Python function to be clearer and safer while preserving behavior. Deliver: 1) Refactored code 2) List of behavior-preserving changes 3) Residual risks / TODOs 4) 3 unit tests (pytest) covering edge cases CODE: <<<paste>>>
Can AI?
- Refactor this messy Python functionPaste into a general LLM and refactor a messy Python function while preserving behavior