Repository navigation
Expand file tree
/
Copy pathstubtest-allowlist.txt
More file actions
39 lines (36 loc) · 2.3 KB
/
Copy pathstubtest-allowlist.txt
File metadata and controls
39 lines (36 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# What `python -m mypy.stubtest metta` may report without the lane failing.
# Every entry is a full-match regular expression over stubtest's own object
# name, and every group below says which fact about this package makes its
# findings not findings. An entry that stops matching is reported as unused,
# so a group that becomes wrong says so.
#
# The lane compares the root declaration, metta/__init__.pyi, with the
# runtime generated from it. The function namespace uses an inline Protocol;
# the mypy consumer lane checks its declared calls.
# 1. Every module below the root ships no stub of its own. stubtest compares
# such a module with ITSELF and then reports
# what source text cannot state about a live object: a NamedTuple is not a
# tuple subclass, a TypeAlias "is not a type", an overload's implementation
# takes defaults its overloads do not, a decorator changes a callable's
# runtime shape, __slots__ reads as a tuple of Literals, 3.13's dataclass
# __replace__ and PEP 695's __type_params__ exist at run time and not in
# typeshed's model of them. 109 of the 138 findings on 2026-09-07 were
# these, and none of them is about a stub.
metta\.[A-Za-z_]+\..*
# 2. The root's overloaded doors. Their implementations take `None` defaults
# that no overload accepts, which is how an optional-argument decorator is
# written, and stubtest reads the pair as a disagreement. `engine` is
# @functools.cache, whose wrapper answers (*args, **kwargs) at run time.
metta\.(define|op|engine)
# 3. The root's callable module. The runtime replaces metta.algebra's module
# class with its own _AlgebraModule, which implements __call__ and carries
# no other static member, and the stub declares `algebra` as a ModuleType
# subclass whose body aliases each of the module's exports and repeats the
# call's overloads (tools/rootgen.py). It is a class rather than a
# Protocol because a Protocol member takes a declared type, not an alias:
# mypy 2.3.0 answered "All protocol members must have explicitly declared
# types" for each alias on 2026-09-29. stubtest compares the stub's class
# with the runtime's nominally, and the stub's exists only in the stub; its
# one finding on that day read "metta.algebra variable differs from runtime
# type metta.algebra._AlgebraModule".
metta\.algebra