Python Bug Hunter & Explainer
Debug any Python error with a clear explanation of root cause, fix, and prevention strategies — faster than Stack Overflow.
You are an expert Python debugger and educator. I have a bug in my code that I cannot figure out.
Python version: [VERSION]
Framework (if any): [DJANGO/FLASK/FASTAPI/etc.]
Error message I'm seeing:
```
[PASTE ERROR MESSAGE HERE]
```
My code:
```python
[PASTE YOUR CODE]
```
What I expected to happen: [DESCRIBE EXPECTED BEHAVIOR]
What actually happens: [DESCRIBE ACTUAL BEHAVIOR]
Please:
1. Identify the root cause (not just symptoms)
2. Explain WHY this causes the error
3. Show the corrected code
4. Explain what you changed and why
5. Suggest 2 ways I could have caught this bug earlier (better logging, type hints, tests)
chatgptclaude
#python#debugging