Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
553aea9
types for core, localedata, some of dates
DenverCoder1 Dec 2, 2022
7b59f48
more dates types
DenverCoder1 Dec 4, 2022
9534bee
more dates types
DenverCoder1 Dec 4, 2022
105c673
more dates types
DenverCoder1 Dec 4, 2022
7ba273c
More types for dates
DenverCoder1 Dec 4, 2022
42ac91d
Add some numbers types
DenverCoder1 Dec 4, 2022
63e37ed
more numbers type annotations
DenverCoder1 Dec 4, 2022
483029f
More type annotations
DenverCoder1 Dec 4, 2022
00e15bb
type annotations for units, util
DenverCoder1 Dec 4, 2022
b663dc1
Formatting and small fixes
DenverCoder1 Dec 4, 2022
a8d195e
Make typing_extensions only required for type checking
DenverCoder1 Dec 4, 2022
941f009
Update support imports
DenverCoder1 Dec 4, 2022
a0c53c1
finish support, plural update
DenverCoder1 Dec 4, 2022
90032bf
Add more type annotations to plural.py
DenverCoder1 Dec 5, 2022
6c8b3d3
More localtime annotations
DenverCoder1 Dec 5, 2022
298a8c1
Fix import order
DenverCoder1 Dec 5, 2022
5f10d90
style: formatting
DenverCoder1 Dec 5, 2022
c07ed4d
Retype from typeshed stubs
DenverCoder1 Dec 15, 2022
89d60c0
Infer additional types
DenverCoder1 Dec 15, 2022
6ea0042
Add types to get_global()
DenverCoder1 Dec 16, 2022
9886da9
Merge branch 'master' into typing
DenverCoder1 Dec 26, 2022
132a9a4
Add babel.messages annotations
DenverCoder1 Jan 6, 2023
32bbc9e
Update .coveragerc
DenverCoder1 Jan 6, 2023
d27288c
Merge branch 'master' into typing
DenverCoder1 Jan 6, 2023
c2fe354
Apply suggestions from code review
DenverCoder1 Jan 8, 2023
25dbcb2
Changes from code review
DenverCoder1 Jan 8, 2023
621cd16
Code changes from review
DenverCoder1 Jan 8, 2023
c868813
Remove less specific list type in get_territory_currencies
DenverCoder1 Jan 8, 2023
1409b14
Fix coverage on overloads
DenverCoder1 Jan 8, 2023
fc1f1ff
Add coverage ignore
DenverCoder1 Jan 8, 2023
d0cb966
Change IO[bytes] | IO[str] to IO[AnyStr]
DenverCoder1 Jan 11, 2023
c3beb51
Merge branch 'master' into typing
DenverCoder1 Jan 11, 2023
05f690f
Merge branch 'master' into typing
DenverCoder1 Jan 11, 2023
c17f6c5
Pre-commit fixes
DenverCoder1 Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Retype from typeshed stubs
  • Loading branch information
DenverCoder1 committed Dec 15, 2022
commit c07ed4db58da1fc538a19fb6dc799e8687aef0cb
4 changes: 2 additions & 2 deletions babel/localtime/_win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
except ImportError:
winreg = None

from typing import Dict, cast
from typing import Any, Dict, cast

import pytz

Expand All @@ -21,7 +21,7 @@
tz_names = {}


def valuestodict(key):
def valuestodict(key) -> dict[str, Any]:
"""Convert a registry key's values to a dictionary."""
dict = {}
size = winreg.QueryInfoKey(key)[1]
Expand Down
8 changes: 5 additions & 3 deletions babel/messages/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
:license: BSD, see LICENSE for more details.
"""

from typing import Any

from babel.messages.catalog import TranslationError, PYTHON_FORMAT


Expand All @@ -21,7 +23,7 @@
]


def num_plurals(catalog, message):
def num_plurals(catalog, message) -> None:
"""Verify the number of plurals in the translation."""
if not message.pluralizable:
if not isinstance(message.string, str):
Expand All @@ -41,7 +43,7 @@ def num_plurals(catalog, message):
catalog.num_plurals)


def python_format(catalog, message):
def python_format(catalog, message) -> None:
"""Verify the format string placeholders in the translation."""
if 'python-format' not in message.flags:
return
Expand Down Expand Up @@ -168,4 +170,4 @@ def _find_checkers():
return checkers


checkers = _find_checkers()
checkers: Any = _find_checkers()
6 changes: 3 additions & 3 deletions babel/messages/mofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from babel.messages.catalog import Catalog, Message


LE_MAGIC = 0x950412de
BE_MAGIC = 0xde120495
LE_MAGIC: int = 0x950412de
BE_MAGIC: int = 0xde120495


def read_mo(fileobj):
Expand Down Expand Up @@ -102,7 +102,7 @@ def read_mo(fileobj):
return catalog


def write_mo(fileobj, catalog, use_fuzzy=False):
def write_mo(fileobj, catalog, use_fuzzy: bool = False) -> None:
"""Write a catalog to the specified file-like object using the GNU MO file
format.

Expand Down
1 change: 1 addition & 0 deletions babel/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Marker file for PEP 561. This package uses inline types.