andrew-d / andrew-d/Hoboken

Datastructure cleanup

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

Descrizione

I'm currently not happy with some of the choices made in hoboken/objects/datastructures.py. This issue is a general list of things that I'd like to re-visit or fix.
- Remove ReturnTranslatingMultiDict
- See if I can remove "**keytrans**" and "**valtrans**" from MultiDict (kinda hack-ish)
- Related to this, the only time that this is used currently is in the cookies mixin, to allow indexing with either bytes or str. Might be worth creating a dedicated class, like "IndifferentMultiDict", or something, that handles just this case.
- CallbackMultiDict currently has some tests xfailed for functions that call on_change multiple times.
- Is this even a problem?
- If so, we probably need to move the functionality into MultiDict, instead of re-implementing the various functions in CallbackMultiDict.
- Or, implement a MutableMapping-derived class that delegates to a MultiDict internally, similar to how we handle CallbackList/CallbackDict. Only downside: it won't actually be a subclass of MultiDict, which means that iter_multi_items will probably misbehave. Could get around this with an ABC, but that seems like overkill.

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.