Closed benoit74 closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
0573638
) to head (ac9249c
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The dict-ness is just the least effort path. Code is regularly updating / merging multiple properties at once, and it is a mess / very verbose to re-implement without the dict facilities (see e.g. update_with_macro
with I don't know how to reimplement with a proper type). Since the main goal was to expose something more useful rather than a problem of maintainability, I considered that dict-ness was the appropriate solution.
That being that, I would also prefer to use a proper type if this does not makes the code too verbose. Shall we use pydantic BaseModel as base class? It would be a new dependency, it would help a bit, even if it would probably not solve all issues
(and using a proper type was also my initial trial, but I quickly realized it was not that convenient to write)
Well I think you did not read my comment to the end and that none of your arguments make sense but given it was late when you replied, I think fresh eyes will have us agree that what I commited is simpler and has no downsides. Revert if that's not the case. I only tested via running the unit tests
I did read it, just I'm not that attached to dict
, and as said I would have preferred to use a proper type that does not subclass dict
.
Let's go with dict
, I will learn how to do it with a proper type next time (and maybe it is just not "wishable"), I like your simplification anyway.
I'll just replace dict
by Dict
to prepare for the future.
Edit: I'll just replace dict by Dict to prepare for the future dict
is already the future ^^
Fix #151
Changes:
i18n.Lang
class to hold returned valuesi18n.get_language_details()
,i18n.get_iso_lang_data()
,i18n.find_language_names()
andi18n.update_with_macro
now process / return a new typedLang
classi18n.NotFound
toi18n.NotFoundError
from previous PR (forgot changelog + few wrong docstrings)