ipython / ipython/traitlets

Better introspection functions: info/repr

Aperta
#459 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
653
Fork
217
Merge medio
2g 21h
PR unite (30g)
2

Descrizione

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).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.