# TypeError: ids must be a list or callable, got <class 'str'>

- **ID:** `python/pytest-fixture-params-ids-type`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在 parametrize 中传递 ids 参数时使用了字符串而不是列表或函数。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |

## Workarounds

1. **使用列表** (98% success)
   ```
   @pytest.mark.parametrize('x', [1,2], ids=['a','b'])
   ```
2. **使用可调用对象** (95% success)
   ```
   @pytest.mark.parametrize('x', [1,2], ids=lambda x: f'id_{x}')
   ```

## Dead Ends

- **ids='a,b'** — 尝试将字符串转换为列表但忘记括号 (40% fail)
- **ids=lambda x: 'id'** — 尝试使用 lambda 但 lambda 返回字符串而非列表 (30% fail)
