Skip to content

Commit 76c0850

Browse files
Use the correct __builtin__/builtins module in Python 2/3. (#569)
1 parent 5161341 commit 76c0850

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stdlib/2and3/locale.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
from typing import Any, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
44
import sys
5-
import builtins
6-
7-
_str = builtins.str # TODO workaround for mypy#2010
85

6+
# workaround for mypy#2010
7+
if sys.version_info < (3,):
8+
import __builtin__
9+
_str = __builtin__.str
10+
else:
11+
import builtins
12+
_str = builtins.str
913

1014
CODESET = ... # type: int
1115
D_T_FMT = ... # type: int
@@ -95,8 +99,8 @@ def format_string(format: _str, val: Sequence[Any],
9599
grouping: bool = ...) -> _str: ...
96100
def currency(val: int, symbol: bool = ..., grouping: bool = ...,
97101
international: bool = ...) -> _str: ...
98-
def str(float: float) -> _str: ...
99102
if sys.version_info >= (3, 5):
100103
def delocalize(string: _str) -> None: ...
101104
def atof(string: _str) -> float: ...
102105
def atoi(string: _str) -> int: ...
106+
def str(float: float) -> _str: ...

0 commit comments

Comments
 (0)