# 列 'tags' 的可变默认值 <list object at 0x...> 不允许。请使用可调用对象。

- **ID:** `python/sqlalchemy-mutable-default-list`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在 Column 中使用可变对象（如列表或字典）作为默认值，可能导致实例间共享状态。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   class Article(Base):
    __tablename__ = 'articles'
    tags = Column(JSON, default=list)  # or default=lambda: []
   ```

## 无效尝试

- **** — Lambda is not serializable and may cause issues with migrations. (30% 失败率)
- **** — Tuple is immutable but may not be suitable for all use cases. (50% 失败率)
