ipython / ipython/traitlets

Possible move of comparison to a separate function inside set

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

Descrizione

``` python
try:
silent = bool(old_value == new_value)
except:
# if there is an error in comparing, default to notify
silent = False
```

When `==` doesn't work (think `np.array` or `pd.DataFrame`), this is equivalent to failing silently in some sense. We should move this section to a separate compare function that can be overload by a `TraitType` so the entire logic of `set` doesn't need to be copied.

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.