# TypeError: 'NoneType' object is not iterable

- **ID:** `python/fastapi-query-param-type-conflict`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Query parameter defined with default None but used in iteration without checking.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Use Optional[List[str]] = Query(None) and then if items: for item in items:
   ```
2. **** (90% success)
   ```
   Use list = Query(default_factory=list) to ensure always iterable
   ```

## Dead Ends

- **** — May still miss cases where param is empty list. (60% fail)
- **** — Mutable default arguments are shared across requests, causing bugs. (80% fail)
