Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type annotation inconsistency #982

Closed
dmoklaf opened this issue Mar 2, 2023 · 1 comment · Fixed by #983
Closed

Type annotation inconsistency #982

dmoklaf opened this issue Mar 2, 2023 · 1 comment · Fixed by #983

Comments

@dmoklaf
Copy link

dmoklaf commented Mar 2, 2023

Overview Description

Babel has inconsistent type annotations (for mypy) in the babel.support.Translations.load method.

Steps to Reproduce

  1. The documentation mentions that babel.support.Translations.load accepts strings but also Locale objects for its locales argument:
    locales – the list of locales in order of preference (items in this list can be either Locale objects or locale strings)
  2. However the code type annotations do not accept Locale objects:
    classmethod load(..., locales: ...str...) → ...
  3. The library behavior indicates that it is the documentation that is correct - Locale objects are accepted by the code

Actual Results

Expected Results

Reproducibility

Tested on babel 2.12.1 with python 3.10.9 through mamba 1.3.1 on MacOS 13.2.1

Additional Information

Documentation available here:
https://babel.pocoo.org/en/latest/api/support.html

@dmoklaf
Copy link
Author

dmoklaf commented Aug 10, 2023

Hi is it possible to release a version with this fix? Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants