Better introspection functions: info/repr
未关闭
- 主要语言
- Python
- 星标
- 653
- 派生
- 217
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 2
描述
Currently, the `info()` method of container / dict traits only use the default `Instance` implementation, leading to rather uninformative information when there are restrictions on the elements, e.g. with a complex structure along the lines of:
```py
trait = Tuple((
CFloat(33),
Unicode('default', allow_none=True),
List(Int(0), min_length=3),
))
```
the info string will simply be `'a tuple'`.
Separately, it would be nice if the base trait types included a `__repr__`, so that a trait could be introspected without having to refer to the source (especially useful for traits constructed dynamically).
贡献指南
评估
这个 Issue 还没有评估数据。