Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Confused about self.parent

Aperta
#840 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Inizia da traitlets/config/configurable.py intorno alla riga 47 e confronta la definizione del parent con i risultati della ricerca nella documentazione. Determina se la documentazione spiega la semantica e l’uso previsto di self.parent; il lavoro è completato quando il comportamento e la relazione con le istanze Configurable parent sono documentati chiaramente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello, I am making heavy use of self.parent in some code I wrote, but:

  1. searching the docs does not define parent
  2. searching the repo for def parent does not yield any results
  3. There are a number of red herrings in the search to understand what self.parent does and where it is documented because of toy examples in the issues and the docs where we have class Child and Class Parent where the Child class has a slot accessed via self.parent ... this is not the self.parent that is being heavily used in my Traitlets-based applications... but for the life of me, I cannot remember why I started using it and what the semantics are.

Actually I think I found it : it's defined as "The parent Configurable instance of this object." ... ah I think I know the purpose of this... it's to get at the Application class that is the parent of the Configurable class so that you can access slots within the Application... is that correct?

Lingua principale
Python
Stelle
653
Fork
217
Merge medio
2g 21h
PR unite (30g)
2

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ipython/traitlets

Tutte le issue di ipython/traitlets

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.