# TypeError: view function takes 1 positional argument but 2 were given

- **ID:** `python/flask-route-argument-type-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

路由定义了 URL 变量，但视图函数参数数量不匹配。

## Version Compatibility

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

## Workarounds

1. **** (100% success)
   ```
   @app.route('/user/<int:user_id>')
def show_user(user_id):
    return f'User {user_id}'
   ```

## Dead Ends

- **** — 默认参数不能解决参数数量不匹配的问题 (85% fail)
- **** — 虽然不报错，但会掩盖问题，导致逻辑错误 (50% fail)
