Skip to content

Commit 2ff7c0d

Browse files
authored
[release 1.5] stubtest: Fix __mypy-replace false positives (#15689) (#15751)
1 parent 373b73a commit 2ff7c0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypy/stubtest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ def verify_typeinfo(
496496
)
497497

498498
# Check everything already defined on the stub class itself (i.e. not inherited)
499-
to_check = set(stub.names)
499+
#
500+
# Filter out non-identifier names, as these are (hopefully always?) whacky/fictional things
501+
# (like __mypy-replace or __mypy-post_init, etc.) that don't exist at runtime,
502+
# and exist purely for internal mypy reasons
503+
to_check = {name for name in stub.names if name.isidentifier()}
500504
# Check all public things on the runtime class
501505
to_check.update(
502506
m for m in vars(runtime) if not is_probably_private(m) and m not in IGNORABLE_CLASS_DUNDERS

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy