alexmojaki / alexmojaki/cheap_repr

dnspython

Aperta
#10 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
26
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I am using cheap-repr for debugging of https://github.com/jayvdb/dns-cache , and the problem I am facing is that https://github.com/rthalley/dnspython has a bunch of classes with a useless `repr`, and they are deeply nested.

The main need for me is the "Answer" class from [`dns.resolver.Resolver.query()`](https://github.com/rthalley/dnspython/blob/fb55767/dns/resolver.py#L804).

I can get a slightly better result by using `register_repr` and returning `x.__dict__`, but then the `response` member is the same, and then if I use its `__dict__`, there is another layer (and that is where the IP addrs, which is what is the most interesting part of the answer).

It would be great if there was a 'recursive `__dict__` repr' which could be easily used.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.