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
Language.get normalizes case and enforces syntactic validity whereas Language.make doesn’t. This causes some discrepancies. I presume that a user is not supposed to have to worry about case or syntactic validity once they have a valid (in the sense of is_valid) Language object.
If Language is valid, its tag should presumably be valid. This is not always true.
Round-tripping a valid Language through its tag should presumably return an equivalent Language. This is not always true.
>>> lang = Language.make(language='FR')
>>> lang.is_valid()
True
>>> lang == Language.get(lang.to_tag(), normalize=False)
False
Alternatively, maybe it is the user’s responsibility to normalize case and check for syntactic validity before calling Language.make. I don’t think the documentation actually says that though.
The text was updated successfully, but these errors were encountered:
Language.get
normalizes case and enforces syntactic validity whereasLanguage.make
doesn’t. This causes some discrepancies. I presume that a user is not supposed to have to worry about case or syntactic validity once they have a valid (in the sense ofis_valid
)Language
object.If
Language
is valid, its tag should presumably be valid. This is not always true.Round-tripping a valid
Language
through its tag should presumably return an equivalentLanguage
. This is not always true.Alternatively, maybe it is the user’s responsibility to normalize case and check for syntactic validity before calling
Language.make
. I don’t think the documentation actually says that though.The text was updated successfully, but these errors were encountered: