ipython / ipython/traitlets

Configurable should warn on unrecognized arguments

未关闭
#926 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
653
派生
217
平均合并
2 天 21 小时
30 天内合并 PR
2

描述

Currently direct `HasTraits` subclasses warn when they receive unrecognized arguments:

https://github.com/ipython/traitlets/blob/b0eaa6aa77e198cff68644a388400db850670c7d/tests/test_traitlets.py#L2802-L2810

However, this does not work with `Configurable` and its subclasses, although it is a subclass of `HasTraits`:

https://github.com/ipython/traitlets/blob/b0eaa6aa77e198cff68644a388400db850670c7d/traitlets/config/configurable.py#L53

![Image](https://github.com/user-attachments/assets/eb8e93c2-1a71-4724-b384-a19344dfca0f)

### Context

This is implemented in:

https://github.com/ipython/traitlets/blob/b0eaa6aa77e198cff68644a388400db850670c7d/traitlets/traitlets.py#L1381-L1399

Related to https://github.com/ipython/traitlets/issues/145.

贡献指南

打开贡献指南

调研方向

Start with the existing unrecognized-argument test in tests/test_traitlets.py, then inspect the related handling in traitlets/traitlets.py and the Configurable definition in traitlets/config/configurable.py. Confirm the behavior for direct HasTraits subclasses and make the corresponding Configurable case warn on unrecognized arguments, with regression coverage showing the warning.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。