Skip to content
Merged
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions stdlib/locale.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from _typeshed import StrPath

# This module defines a function "str()", which is why "str" can't be used
# as a type annotation or type alias.
Expand Down Expand Up @@ -103,6 +104,17 @@ def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ...
def atoi(string: _str) -> int: ...
def str(val: float) -> _str: ...

# native gettext functions
# https://docs.python.org/3/library/locale.html#access-to-message-catalogs
# https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Modules/_localemodule.c#L626
if sys.platform == "linux" or sys.platform == "darwin":
def gettext(__msg: _str) -> _str: ...
def dgettext(__domain: _str | None, __msg: _str) -> _str: ...
def dcgettext(__domain: _str | None, __msg: _str, __category: int) -> _str: ...
def textdomain(__domain: _str | None) -> _str: ...
def bindtextdomain(__domain: _str, __dir: StrPath | None) -> _str: ...
def bind_textdomain_codeset(__domain: _str, __codeset: _str | None) -> _str | None: ...

Comment thread
LunNova marked this conversation as resolved.
Resolved
locale_alias: dict[_str, _str] # undocumented
locale_encoding_alias: dict[_str, _str] # undocumented
windows_locale: dict[int, _str] # undocumented