2
Debug my Python code like a senior engineer
Paste your code, get a disciplined diagnosis, and improve the fix with tests and safer implementation choices.
1 comments96 views2 steps
Comments
Paste your code, get a disciplined diagnosis, and improve the fix with tests and safer implementation choices.
Review this Python error like a senior engineer. Start by identifying the smallest reproduction.
Write down the input, expected behavior, actual behavior, and exact traceback. Remove unrelated code until the failure remains in the smallest possible test.
Suggest the smallest safe fix and the regression tests it needs.
Change only the violated assumption, add a test for the reported case plus its boundary cases, then run the surrounding suite before considering a refactor.
Comments 1
Reproducing first saves so much time. I would also ask for the Python version and dependency lockfile.