Babel 2.5.0
For currencies the functions babel.numbers.is_currency and babel.numbers.normalize_currency accept quite a few values (None, strings, numbers, lists, sets) and return the expected result (a boolean or a string).
The functions babel.localedata.normalize_locale and babel.localedata.exists raise an exception in most cases except when a string is provided.
It would be nice if these functions behaved the same way (at least for None?) so that the following approach can be used:
my_locale = babel.localedata.normalize_locale(my_locale)
my_currency = babel.numbers.normalize_currency(my_currency)
# at this point, the values are correct strings or None
Babel 2.5.0
For currencies the functions
babel.numbers.is_currencyandbabel.numbers.normalize_currencyaccept quite a few values (None, strings, numbers, lists, sets) and return the expected result (a boolean or a string).The functions
babel.localedata.normalize_localeandbabel.localedata.existsraise an exception in most cases except when a string is provided.It would be nice if these functions behaved the same way (at least for
None?) so that the following approach can be used: