You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is playing fast and loose with types for locales, and sometimes it's sending Locale objects and sometimes just strings, even when the type hint requests one type.
The Locale enum doesn't add much functionality, and it causes issues when the wrong type is passed (e.g. if the code expects a Locale but receives a string, or vice versa, an exception is thrown unless you handle it).
A string + maybe one validation function like is_locale(locale): return locale.lower() in ("en_us", "fr_fr") would simplify things.
The code is playing fast and loose with types for locales, and sometimes it's sending Locale objects and sometimes just strings, even when the type hint requests one type.
The Locale enum doesn't add much functionality, and it causes issues when the wrong type is passed (e.g. if the code expects a Locale but receives a string, or vice versa, an exception is thrown unless you handle it).
A string + maybe one validation function like
is_locale(locale): return locale.lower() in ("en_us", "fr_fr")
would simplify things.@bkorycki @rogthefrog discussed this in Discord.
The text was updated successfully, but these errors were encountered: