What should the type of super() be?

Aperta
#2,956 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
devtools

Direzione di ricerca

Reproduce the mypy 0.501 error using the code in zerver/storage.py, focusing on the type: ignore on the super(AddHeaderMixin, self) line and the following super_ret attribute access. Trace how mypy applies that suppression, and consider the issue resolved when the reported error is correctly suppressed without requiring another ignore on super_ret.

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

Descrizione

feature priority-2-low

I found this new error that seems to have escaped a type: ignore when trying out the mypy 0.501:

zerver/storage.py:47: error: "super" has no attribute "post_process"

The code in question is https://github.com/zulip/zulip/blob/master/zerver/storage.py, the relevant block is the super_ret line below:

        super_class = super(AddHeaderMixin, self) # type: ignore # https://github.com/JukkaL/mypy/issues/857      
        if hasattr(super_class, 'post_process'):                                                                  
            super_ret = super_class.post_process(paths, dry_run, **kwargs)                                        
        else:                                                                                                     
            super_ret = []                                                                                        

I'll just add another type: ignore on the super_ret line for now, but I think it's a bug that mypy didn't suppress that.

Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Merge medio
1g 18h
PR unite (30g)
54

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 python/mypy

Tutte le issue di python/mypy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.