8000 allowlist new "not a function" errors (#5155) · python/typeshed@54392b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 54392b1

Browse files
authored
allowlist new "not a function" errors (#5155)
stubtest now checks this for overloads as well (previously it didn't, due to some combination of laziness, that this used to short circuit and prevent signature checking, and the fact that these are all not super helpful) Co-authored-by: hauntsaninja <>
1 parent 1ed1e00 commit 54392b1

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

tests/stubtest_whitelists/py37.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ concurrent.futures.ProcessPoolExecutor.map
2727
contextvars.Context.__init__
2828
contextvars.Context.get
2929
contextvars.ContextVar.get
30+
contextlib.nullcontext # not a function at runtime
3031
copy.PyStringMap
3132
ctypes.CDLL.__init__
3233
dataclasses.field

tests/stubtest_whitelists/py38.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ collections.abc.ItemsView.__reversed__
3838
collections.abc.KeysView.__reversed__
3939
collections.abc.ValuesView.__reversed__
4040
concurrent.futures.ProcessPoolExecutor.map
41+
contextlib.nullcontext # not a function at runtime
4142
contextvars.Context.__init__
4243
contextvars.Context.get
4344
copy.PyStringMap

tests/stubtest_whitelists/py39.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ collections.abc.AsyncGenerator.ag_running
4545
collections.abc.ItemsView.__reversed__
4646
collections.abc.KeysView.__reversed__
4747
collections.abc.ValuesView.__reversed__
48+
contextlib.nullcontext # not a function at runtime
4849
contextvars.Context.__init__
4950
contextvars.Context.get
5051
copy.PyStringMap
51-
# This was changed in Python 3.9.2.
5252
curses.color_pair
5353
dataclasses.field
5454
dataclasses.InitVar.__class_getitem__ # stubtest bug. doesn't do the right thing with overload + implicit classmethod __class_getitem__

tests/stubtest_whitelists/py3_common.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ _collections_abc.Set.isdisjoint
2424
_csv.Dialect.__init__
2525
_dummy_threading
2626
_importlib_modulespec
27+
_operator.attrgetter # not a function at runtime
28+
_operator.itemgetter # not a function at runtime
2729
_operator.methodcaller
2830
_threading_local.local.__new__
2931
_typeshed.* # Utility types for typeshed, doesn't exist at runtime
@@ -57,7 +59,9 @@ builtins.bytes.__int__
5759
builtins.bytes.maketrans
5860
builtins.classmethod.__get__
5961
builtins.ellipsis
62+
builtins.filter # not a function at runtime
6063
builtins.function
64+
builtins.map # not a function at runtime
6165
builtins.memoryview.__contains__
6266
builtins.memoryview.__iter__
6367
builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only
@@ -66,7 +70,9 @@ builtins.property.__get__
6670
builtins.property.fdel
6771
builtins.property.fget
6872
builtins.property.fset
73+
builtins.reversed # not a function at runtime
6974
builtins.staticmethod.__get__
75+
builtins.zip # not a function at runtime
7076
bz2.BZ2Decompressor.__init__
7177
bz2.BZ2File.readinto
7278
bz2.BZ2File.readlines
@@ -247,13 +253,19 @@ ipaddress._BaseAddress.is_unspecified
247253
ipaddress._BaseAddress.max_prefixlen
248254
ipaddress._BaseAddress.packed
249255
ipaddress._BaseNetwork.max_prefixlen
256+
itertools.accumulate # not a function at runtime
250257
itertools.chain.from_iterable
258+
itertools.combinations # not a function at runtime
251259
itertools.combinations_with_replacement
252260
itertools.compress
253261
itertools.count
254262
itertools.dropwhile
255263
itertools.filterfalse
264+
itertools.groupby # not a function at runtime
265+
itertools.islice # not a function at runtime
256266
itertools.permutations
267+
itertools.product # not a function at runtime
268+
itertools.repeat # not a function at runtime
257269
itertools.starmap
258270
itertools.takewhile
259271
itertools.zip_longest
@@ -302,6 +314,8 @@ netrc.NetrcParseError.__init__
302314
netrc.netrc.__init__
303315
ntpath.join
304316
numbers.Number.__hash__
317+
operator.attrgetter # not a function at runtime
318+
operator.itemgetter # not a function at runtime
305319
operator.methodcaller
306320
optparse.HelpFormatter._format__Text
307321
optparse.OptionParser.__init__

0 commit comments

Comments
 (0)
0