Improve locale (#462)

This commit is contained in:
Valérian Rousset
2016-08-10 22:52:29 +02:00
committed by Guido van Rossum
parent 59d06de83e
commit 2824cd1197
4 changed files with 77 additions and 190 deletions

View File

@@ -1,81 +0,0 @@
from typing import Optional, Dict, Any
ABDAY_1 = ... # type: int
ABDAY_2 = ... # type: int
ABDAY_3 = ... # type: int
ABDAY_4 = ... # type: int
ABDAY_5 = ... # type: int
ABDAY_6 = ... # type: int
ABDAY_7 = ... # type: int
ABMON_1 = ... # type: int
ABMON_10 = ... # type: int
ABMON_11 = ... # type: int
ABMON_12 = ... # type: int
ABMON_2 = ... # type: int
ABMON_3 = ... # type: int
ABMON_4 = ... # type: int
ABMON_5 = ... # type: int
ABMON_6 = ... # type: int
ABMON_7 = ... # type: int
ABMON_8 = ... # type: int
ABMON_9 = ... # type: int
ALT_DIGITS = ... # type: int
AM_STR = ... # type: int
CHAR_MAX = ... # type: int
CODESET = ... # type: int
CRNCYSTR = ... # type: int
DAY_1 = ... # type: int
DAY_2 = ... # type: int
DAY_3 = ... # type: int
DAY_4 = ... # type: int
DAY_5 = ... # type: int
DAY_6 = ... # type: int
DAY_7 = ... # type: int
D_FMT = ... # type: int
D_T_FMT = ... # type: int
ERA = ... # type: int
ERA_D_FMT = ... # type: int
ERA_D_T_FMT = ... # type: int
ERA_T_FMT = ... # type: int
LC_ALL = ... # type: int
LC_COLLATE = ... # type: int
LC_CTYPE = ... # type: int
LC_MESSAGES = ... # type: int
LC_MONETARY = ... # type: int
LC_NUMERIC = ... # type: int
LC_TIME = ... # type: int
MON_1 = ... # type: int
MON_10 = ... # type: int
MON_11 = ... # type: int
MON_12 = ... # type: int
MON_2 = ... # type: int
MON_3 = ... # type: int
MON_4 = ... # type: int
MON_5 = ... # type: int
MON_6 = ... # type: int
MON_7 = ... # type: int
MON_8 = ... # type: int
MON_9 = ... # type: int
NOEXPR = ... # type: int
PM_STR = ... # type: int
RADIXCHAR = ... # type: int
THOUSEP = ... # type: int
T_FMT = ... # type: int
T_FMT_AMPM = ... # type: int
YESEXPR = ... # type: int
_DATE_FMT = ... # type: int
class Error(Exception):
pass
def bind_textdomain_codeset(domain: Optional[str], codeset: Optional[str]) -> Optional[str]: pass
def bindtextdomain(domain: Optional[str], dir: Optional[str]) -> str: pass
def dcgettext(domain: Optional[str], msg: str, category: int) -> str: pass
def dgettext(domain: Optional[str], msg: str) -> str: pass
def gettext(msg: str) -> str: pass
def localeconv() -> Dict[str, Any]: pass
def nl_langinfo(key: int) -> str: pass
def setlocale(i: int, s: str) -> str: pass
def strcoll(left: str, right: str) -> int: pass
def strxfrm(s: str) -> str: pass
def textdomain(domain: Optional[str]) -> str: pass

View File

@@ -1,33 +0,0 @@
# Stubs for locale (Python 2)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
from _locale import *
class _unicode: ...
CHAR_MAX = ... # type: Any
LC_ALL = ... # type: Any
LC_COLLATE = ... # type: Any
LC_CTYPE = ... # type: Any
LC_MESSAGES = ... # type: Any
LC_MONETARY = ... # type: Any
LC_NUMERIC = ... # type: Any
LC_TIME = ... # type: Any
Error = ... # type: Any
def localeconv(): ...
def strcoll(a, b): ...
def strxfrm(s): ...
def format(percent, value, grouping=False, monetary=False, *additional): ...
def format_string(f, val, grouping=False): ...
def currency(val, symbol=True, grouping=False, international=False): ...
def str(val): ...
def atof(string, func=...): ...
def atoi(str): ...
def normalize(localename): ...
def getdefaultlocale(envvars=...): ...
def getlocale(category=...): ...
def resetlocale(category=...): ...
def getpreferredencoding(do_setlocale=True): ...

View File

@@ -1,33 +1,18 @@
# Stubs for _locale (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
# Stubs for locale
from typing import Any, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
import sys
import builtins
_str = builtins.str # TODO workaround for mypy#2010
from typing import Iterable
ABDAY_1 = ... # type: int
ABDAY_2 = ... # type: int
ABDAY_3 = ... # type: int
ABDAY_4 = ... # type: int
ABDAY_5 = ... # type: int
ABDAY_6 = ... # type: int
ABDAY_7 = ... # type: int
ABMON_1 = ... # type: int
ABMON_10 = ... # type: int
ABMON_11 = ... # type: int
ABMON_12 = ... # type: int
ABMON_2 = ... # type: int
ABMON_3 = ... # type: int
ABMON_4 = ... # type: int
ABMON_5 = ... # type: int
ABMON_6 = ... # type: int
ABMON_7 = ... # type: int
ABMON_8 = ... # type: int
ABMON_9 = ... # type: int
ALT_DIGITS = ... # type: int
AM_STR = ... # type: int
CHAR_MAX = ... # type: int
CODESET = ... # type: int
CRNCYSTR = ... # type: int
D_T_FMT = ... # type: int
D_FMT = ... # type: int
T_FMT = ... # type: int
T_FMT_AMPM = ... # type: int
DAY_1 = ... # type: int
DAY_2 = ... # type: int
DAY_3 = ... # type: int
@@ -35,23 +20,15 @@ DAY_4 = ... # type: int
DAY_5 = ... # type: int
DAY_6 = ... # type: int
DAY_7 = ... # type: int
D_FMT = ... # type: int
D_T_FMT = ... # type: int
ERA = ... # type: int
ERA_D_FMT = ... # type: int
ERA_D_T_FMT = ... # type: int
ERA_T_FMT = ... # type: int
LC_ALL = ... # type: int
LC_COLLATE = ... # type: int
LC_CTYPE = ... # type: int
LC_MESSAGES = ... # type: int
LC_MONETARY = ... # type: int
LC_NUMERIC = ... # type: int
LC_TIME = ... # type: int
ABDAY_1 = ... # type: int
ABDAY_2 = ... # type: int
ABDAY_3 = ... # type: int
ABDAY_4 = ... # type: int
ABDAY_5 = ... # type: int
ABDAY_6 = ... # type: int
ABDAY_7 = ... # type: int
MON_1 = ... # type: int
MON_10 = ... # type: int
MON_11 = ... # type: int
MON_12 = ... # type: int
MON_2 = ... # type: int
MON_3 = ... # type: int
MON_4 = ... # type: int
@@ -60,25 +37,66 @@ MON_6 = ... # type: int
MON_7 = ... # type: int
MON_8 = ... # type: int
MON_9 = ... # type: int
NOEXPR = ... # type: int
PM_STR = ... # type: int
MON_10 = ... # type: int
MON_11 = ... # type: int
MON_12 = ... # type: int
ABMON_1 = ... # type: int
ABMON_2 = ... # type: int
ABMON_3 = ... # type: int
ABMON_4 = ... # type: int
ABMON_5 = ... # type: int
ABMON_6 = ... # type: int
ABMON_7 = ... # type: int
ABMON_8 = ... # type: int
ABMON_9 = ... # type: int
ABMON_10 = ... # type: int
ABMON_11 = ... # type: int
ABMON_12 = ... # type: int
RADIXCHAR = ... # type: int
THOUSEP = ... # type: int
T_FMT = ... # type: int
T_FMT_AMPM = ... # type: int
YESEXPR = ... # type: int
_DATE_FMT = ... # type: int
NOEXPR = ... # type: int
CRNCYSTR = ... # type: int
def bind_textdomain_codeset(domain, codeset): ...
def bindtextdomain(domain, dir): ...
def dcgettext(domain, msg, category): ...
def dgettext(domain, msg): ...
def gettext(msg): ...
def localeconv(): ...
def nl_langinfo(key): ...
def setlocale(category: int, locale: Iterable[str] = ...) -> str: ...
def strcoll(string1, string2) -> int: ...
def strxfrm(string): ...
def textdomain(domain): ...
ERA = ... # type: int
ERA_D_T_FMT = ... # type: int
ERA_D_FMT = ... # type: int
ERA_T_FMT = ... # type: int
ALT_DIGITS = ... # type: int
LC_CTYPE = ... # type: int
LC_COLLATE = ... # type: int
LC_TIME = ... # type: int
LC_MONETARY = ... # type: int
LC_MESSAGES = ... # type: int
LC_NUMERIC = ... # type: int
LC_ALL = ... # type: int
CHAR_MAX = ... # type: int
class Error(Exception): ...
def setlocale(category: int,
locale: Union[_str, Iterable[_str], None] = ...) -> _str: ...
def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ...
def nl_langinfo(option: int) -> _str: ...
def getdefaultlocale(envvars: Tuple[_str] = ...) -> Tuple[Optional[_str], Optional[_str]]: ...
def getlocale(category: int = ...) -> Sequence[_str]: ...
def getpreferredencoding(do_setlocale: bool = ...) -> _str: ...
def normalize(localename: _str) -> _str: ...
def resetlocale(category: int = ...) -> None: ...
def strcoll(string1: _str, string2: _str) -> int: ...
def strxfrm(string: _str) -> _str: ...
def format(format: _str, val: int, grouping: bool = ...,
monetary: bool = ...) -> _str: ...
def format_string(format: _str, val: Sequence[Any],
grouping: bool = ...) -> _str: ...
def currency(val: int, symbol: bool = ..., grouping: bool = ...,
international: bool = ...) -> _str: ...
def str(float: float) -> _str: ...
if sys.version_info >= (3, 5):
def delocalize(string: _str) -> None: ...
def atof(string: _str) -> float: ...
def atoi(string: _str) -> int: ...

View File

@@ -1,17 +0,0 @@
# Stubs for locale (Python 3.4)
#
# NOTE: This stub is based on a stub automatically generated by stubgen.
from _locale import *
def format(percent, value, grouping=..., monetary=..., *additional): ...
def format_string(f, val, grouping=...): ...
def currency(val, symbol=..., grouping=..., international=...): ...
def str(val): ...
def atof(string, func=...): ...
def atoi(str): ...
def normalize(localename): ...
def getdefaultlocale(envvars=...): ...
def getlocale(category=...): ...
def resetlocale(category=...): ...
def getpreferredencoding(do_setlocale=...): ...