ipython / ipython/traitlets

Application.print_alias_help() should take into account *any* Configurable class

Offen
#499 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
653
Forks
217
Ø Merge
2 T. 21 Std.
Gemergte PRs (30 T.)
2

Beschreibung

It seems to me that in both the current release and the master version (where the code has been moved to emit_alias_help), the case where an alias refers to a class that is *not* in the inheritance hierarchy for a given instance will throw an error. Luckily, one can *use* such aliases (I do in my own projects, it's a nice way to share configurations between classes), it's just one can't print help.

The relevant code in master is (lines 389-393 in config/application.py):
```
classdict = {}
for cls in self.classes:
# include all parents (up to, but excluding Configurable) in available names
for c in cls.mro()[:-3]:
classdict[c.__name__] = c
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.