Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
9790459
sdist: include `misc/{diff-cache,apply-cache-diff}.py` for `mypy/test…
mr-c Mar 26, 2026
b7e311e
Add suggestions for misspelled module imports (#20695)
KevinRK29 Mar 30, 2026
620af70
Improve "Name is not defined" errors with fuzzy matching (#20693)
KevinRK29 Mar 30, 2026
ef7e8a6
Improve error messages when positional argument is missing (#20591)
KevinRK29 Mar 30, 2026
25b210d
docs: clarify that invariant-by-default applies to legacy TypeVar syn…
nuglifeleoji Mar 30, 2026
e5f9c0d
--allow-redefinition-new is no longer experimental (#21110)
JukkaL Mar 31, 2026
3c13caf
[mypyc] Document librt and librt.base64 (#21114)
JukkaL Mar 31, 2026
28866ea
Use 'native-parser' instead of 'native-parse' for optional dependency…
JukkaL Mar 31, 2026
95ddf1c
Bump version to 2.0.0+dev (#21116)
JukkaL Mar 31, 2026
e802d5e
Changelog updates for 1.20 (#21109)
JukkaL Mar 31, 2026
465b887
Changelog: fix line endings to match (#21118)
mr-c Mar 31, 2026
a25c331
docs: rename "value restriction" to "value-constrained type variable"…
nuglifeleoji Mar 31, 2026
3fbbd55
[mypyc] Add vec iterators (#21135)
JukkaL Apr 1, 2026
24b4a81
Include 2 more files in the sdist: CREDITS & typeshed/stdlib/_typeshe…
mr-c Apr 1, 2026
c5af8af
[mypyc] Add __contains__ method to vec (#21138)
JukkaL Apr 1, 2026
554fb8c
--warn-unused-config should not be a strict flag (#21139)
ilevkivskyi Apr 1, 2026
232697e
Avoid narrowing to unreachable at module level (#21144)
hauntsaninja Apr 2, 2026
d7e3268
Allow dangerous identity comparisons to Any typed variables (#21142)
hauntsaninja Apr 2, 2026
38d9152
Improve traceback display (#21155)
hauntsaninja Apr 3, 2026
bdb0dd4
Fix reachability for frozenset and dict view narrowing (#21151)
hauntsaninja Apr 3, 2026
e70166a
Fix regression for catching empty tuple in except (#21153)
hauntsaninja Apr 3, 2026
1c815c2
Fix narrowing with chained comparison (#21150)
hauntsaninja Apr 3, 2026
e5cd1f9
Use stricter config in all match statement tests (#21161)
hauntsaninja Apr 3, 2026
ea00101
Surface false positive hidden by issue with fixtures (#21162)
hauntsaninja Apr 4, 2026
3cda6ec
Mention what codes are actually ignored in `not covered by "type: ign…
wyattscarpenter Apr 4, 2026
a7bdffd
Sync typeshed (#21124)
github-actions[bot] Apr 4, 2026
c8f4074
Always disable sync in SQLite cache (#21184)
ilevkivskyi Apr 8, 2026
bb05513
Fix exception handler target location in new parser (#21185)
ilevkivskyi Apr 8, 2026
220424a
Temporarily skip few base64 tests (#21193)
ilevkivskyi Apr 9, 2026
6cbd2cc
Revert dict.__or__ typeshed change (#21186)
ilevkivskyi Apr 9, 2026
801c0e5
Avoid narrowing type[T] in type calls (#21174)
hauntsaninja Apr 9, 2026
4c85ff0
Prepare fixup for lazy deserialization (#21170)
ilevkivskyi Apr 9, 2026
507cfb0
Add librt functionality for lazy deserialization (#21158)
ilevkivskyi Apr 9, 2026
ef28d9c
Narrow Any in and_conditional_map (#21167)
hauntsaninja Apr 9, 2026
f394946
Fix narrowing for match case with variadic tuples (#21192)
hauntsaninja Apr 9, 2026
a399e1c
Add `install_types` to `OPTIONS_AFFECTING_CACHE` (#21070)
brianschubert Apr 10, 2026
c6d938e
[mypyc] Fix b64decode to match new cpython behavior (#21200)
p-sawicki Apr 10, 2026
be51e9c
Add proper lazy deserialization (#21198)
ilevkivskyi Apr 10, 2026
fed3593
Fix parallel worker crash on syntax error (#21202)
ilevkivskyi Apr 10, 2026
949ccd0
Optimize parallel workers start-up (#21203)
ilevkivskyi Apr 12, 2026
5666c91
Use WAL with SQLite cache, fix close (#21154)
hauntsaninja Apr 13, 2026
c22629d
Disable GC freeze hack in parallel workers (#21207)
ilevkivskyi Apr 13, 2026
f315c8a
Update changelog for 1.20.1 (#21205)
hauntsaninja Apr 13, 2026
272a1ea
Determine development version hash without running git (#21212)
JukkaL Apr 13, 2026
289f408
Fix match statement semantics for "or" pattern (#21156)
hauntsaninja Apr 13, 2026
3b75363
Parse files in parallel when possible (#21175)
ilevkivskyi Apr 13, 2026
f854e35
Fix self check on macOS (#21214)
JukkaL Apr 13, 2026
f922c5e
Clean up native parser implementation a bit (#21213)
JukkaL Apr 13, 2026
ea8efbd
Start moving away from named_type callback architecture (#21201)
ilevkivskyi Apr 13, 2026
20acf99
[mypyc] Move API table definitions to .c files (#21183)
p-sawicki Apr 13, 2026
ff31bb2
Correctly aggregate narrowing information on parent expressions (#21206)
hauntsaninja Apr 13, 2026
8f2e6ad
Fix is_overlapping_types for generic callables (#21208)
hauntsaninja Apr 13, 2026
c90b301
Propagate narrowing within chained comparisons (#21160)
hauntsaninja Apr 13, 2026
c51a81e
Only set journal mode in coordinator (#21217)
ilevkivskyi Apr 14, 2026
5e2ef78
Split type-checking into interface and implementation in parallel wor…
ilevkivskyi Apr 14, 2026
cd71671
Order cases in native parser based on AST node frequency (#21219)
JukkaL Apr 14, 2026
8d58fce
[mypyc] Add new type for expressing header dependencies (#21223)
p-sawicki Apr 14, 2026
8e3c99a
Report parallel worker exit status on receive failure (#21224)
JukkaL Apr 14, 2026
19cf4d9
Fix Windows IPC race condition when using parallel checking (#21228)
JukkaL Apr 14, 2026
0eb7292
Use parallel checking in self check (#21221)
JukkaL Apr 14, 2026
f012a53
Narrow unions containing Any in and_conditional_map (#21231)
hauntsaninja Apr 15, 2026
f1ff74d
Fix various test flakiness on Windows (#21220)
ilevkivskyi Apr 15, 2026
2c93219
Better support for incremental tests in parallel mode (#21234)
ilevkivskyi Apr 15, 2026
d0f5550
[mypyc] Report an error if an acyclic class inherits from non-acyclic…
p-sawicki Apr 15, 2026
a475a9a
[mypyc] Resolve type aliases in function specialization (#21233)
esarp Apr 15, 2026
043a83f
Better metastore close in mypyc test logic (#21250)
hauntsaninja Apr 16, 2026
7fb17fd
[mypyc] Fix reference leaks in list/dict.clear (#21244)
hauntsaninja Apr 16, 2026
06c9e27
[mypyc] Release boxed operands in tagged true division (#21246)
hauntsaninja Apr 16, 2026
22610a2
[mypyc] Fix refleak in str index (#21251)
hauntsaninja Apr 16, 2026
c6795cc
[mypyc] Avoid null decrefs in import errors (#21247)
hauntsaninja Apr 16, 2026
fc410cb
[mypyc] Fix semantics for walrus expression in tuple (#21249)
hauntsaninja Apr 16, 2026
aac7360
[mypyc] Fix `@property` getter memory leak (#21230)
VaggelisD Apr 16, 2026
c65ed9a
Un-support narrowing final globals in functions (#21241)
ilevkivskyi Apr 16, 2026
ba4f018
[mypyc] Release new instances when `__init__` raises (#21248)
hauntsaninja Apr 16, 2026
4f94903
Don't suggest Foo[...] when Foo(arg=...) is used in annotation (#21238)
yosofbadr Apr 16, 2026
f551cb4
Drop support for `--python-version 3.9` (#21243)
hauntsaninja Apr 16, 2026
958c4ba
Cleanup some more tests after dropping 3.9 support (#21256)
cdce8p Apr 16, 2026
ebaa73a
Initial support for Python 3.15.0a8 (#21255)
cdce8p Apr 16, 2026
dee7b3d
Update pythoncapi_compat.h (#21257)
hauntsaninja Apr 16, 2026
d779750
Fix plugins logic in split type checking (#21252)
ilevkivskyi Apr 16, 2026
410f933
Fix stubtest false positive for properties with a deleter (#21259)
pranavmanglik Apr 17, 2026
3c3065c
Improve error messages for unexpected keyword arguments in overloaded…
KevinRK29 Apr 17, 2026
ef03ccd
[mypyc] Incref items before releasing tuple (#21245)
hauntsaninja Apr 17, 2026
30e8f1d
Enable strict_bytes by default (#18371)
hauntsaninja Apr 20, 2026
f8127c8
Make --local-partial-types the default (#21163)
hauntsaninja Apr 20, 2026
15f1287
Use parallel parsing at all stages (#21266)
ilevkivskyi Apr 20, 2026
bf62d3e
Document that --strict-bytes is enabled by default (#21272)
JukkaL Apr 20, 2026
dc6f6ee
Document that --local-partial-types are enabled by default (#21274)
JukkaL Apr 20, 2026
9e76d34
Straighten interface/implementation boundary (#21270)
ilevkivskyi Apr 20, 2026
ddecd74
Fix another test with unstable error order in parallel mode (#21278)
ilevkivskyi Apr 20, 2026
2fbfc29
Delete Python 2 extra (#18374)
hauntsaninja Apr 21, 2026
e7f6044
Remove logic for legacy bundled stubs (#18372)
hauntsaninja Apr 21, 2026
10ea945
Prevent assignment to None for non-Optional class variables (#20054)
hauntsaninja Apr 21, 2026
944e15b
Update changelog for some mypy 2 changes (#21279)
hauntsaninja Apr 21, 2026
93bc02b
Avoid widening types in conditional_types (#21242)
hauntsaninja Apr 21, 2026
2dc89dc
Fix slicing with nonstrict optional (#21282)
hauntsaninja Apr 21, 2026
1b7ff0e
[mypyc] Set dunder attrs when adding module to sys.modules (#21275)
p-sawicki Apr 21, 2026
f4db3cd
stubtest: basic support for unpack kwargs (#21024)
hauntsaninja Apr 22, 2026
eb41eb1
Let --allow-redefinition-new widen global in function with None init …
JukkaL Apr 22, 2026
18f0808
Add changelog entries for 1.20.2 (#21288)
JukkaL Apr 22, 2026
880e9b6
Update ast-serialize requirement to >=0.2.0 (#21289)
JukkaL Apr 22, 2026
3bf45e6
Fix #20958: Support .git/info/exclude for --exclude-gitignore (#21286)
RogerJinIS Apr 22, 2026
781f1e6
Fix sequential bottleneck in parallel parsing (#21291)
JukkaL Apr 22, 2026
4c68d1b
Make --allow-redefinition mean --allow-redefinition-new (#21276)
JukkaL Apr 22, 2026
2b136f0
Narrow context fallback limitation to walrus only (#21294)
ilevkivskyi Apr 22, 2026
db2faa7
Batch SCCs for parallel processing (#21287)
ilevkivskyi Apr 23, 2026
ee9c9e1
Use sharding for sqlite cache (16 shards) (#21292)
JukkaL Apr 23, 2026
3b2b1dd
Fix pathspec error (#21296)
ilevkivskyi Apr 23, 2026
64e5052
Depend on ast-serialize by default (#21297)
JukkaL Apr 23, 2026
6e608f2
Improve call expressions in type annotations with native parser (#21300)
JukkaL Apr 23, 2026
c56ab58
[mypyc] Generate more type methods for types with managed dicts (#21290)
p-sawicki Apr 23, 2026
67d35af
Fix test with unstable error order (#21301)
p-sawicki Apr 23, 2026
d99e2c9
librt: Fix aliasing related segfault with vec append (#21303)
JukkaL Apr 23, 2026
643c2ac
Re-introduce GC freeze hack into parallel checking (#21302)
ilevkivskyi Apr 24, 2026
a1d7781
Do not call best_matches() unless we show the message (#21307)
ilevkivskyi Apr 24, 2026
aa9b516
Write serialized options to a file to broadcast to workers (#21306)
ilevkivskyi Apr 24, 2026
fd11e89
[mypyc] Mark librt.time.time() non-experimental (#21310)
ilevkivskyi Apr 24, 2026
42f66fd
[mypyc] Fix librt API/ABI version checks (#21311)
JukkaL Apr 24, 2026
0653fa0
[mypyc] Various librt.strings fixes (#21314)
JukkaL Apr 24, 2026
6710142
[mypyc] librt.strings no longer behind experimental compiler flag (#2…
JukkaL Apr 24, 2026
d2ad1c7
librt: Support specifying vec capacity during construction (#21304)
JukkaL Apr 24, 2026
aaf6002
Fix time op now that it is no longer experimental (#21318)
ilevkivskyi Apr 24, 2026
1e96fb7
Better narrowing for enums and other types with known equality (#21281)
hauntsaninja Apr 24, 2026
cf845c1
Minor fixes in parallel checking (#21319)
ilevkivskyi Apr 24, 2026
b9147fe
Always respect @no_type_check in two-phase checking (#21320)
ilevkivskyi Apr 24, 2026
680c1ac
[mypyc] Fix capsule deps of librt.internal.(Write|Read)Buffer (#21329)
JukkaL Apr 25, 2026
b6ec270
Handle reachability consistently in two-phase checking (#21322)
ilevkivskyi Apr 25, 2026
52a1c48
Partially support old NumPy plugin in parallel type checking (#21324)
ilevkivskyi Apr 25, 2026
bbe68d3
Support --package-root with native parser (#21321)
ilevkivskyi Apr 25, 2026
6d49fbf
Avoid various NamedTuples (#21326)
hauntsaninja Apr 25, 2026
273e8c8
Narrow more sequence parents (#21327)
hauntsaninja Apr 25, 2026
a850b66
Add support for Final[...] in dataclasses (#21334)
ilevkivskyi Apr 26, 2026
da21dae
Behave consistently when type-checking stub package directly (#21330)
ilevkivskyi Apr 27, 2026
c840a3b
[mypyc] Add vec extend function to librt.vecs (#21340)
JukkaL Apr 27, 2026
07e4612
Test for type comment on last line of assignment (#21333)
ilevkivskyi Apr 27, 2026
a07812d
Fail fast when user tries to generate reports with parallel workers (…
ilevkivskyi Apr 27, 2026
be46935
Make type variable upper bound narrowing symmetric (#21350)
ilevkivskyi Apr 28, 2026
38c3fcb
[mypyc] Use memory copy for vec init and extend using buffer protocol…
JukkaL Apr 28, 2026
f94d18c
[mypyc] Faster vec init and extend with bytes arguments (#21355)
JukkaL Apr 28, 2026
c4b9a29
Fix narrowing for AbstractSet and Mapping (#21352)
hauntsaninja Apr 28, 2026
c3571fa
[mypyc] Fix incremental compilation with `separate` flag (1/3) (#21299)
VaggelisD Apr 28, 2026
a464c9a
[mypyc] Add primitive for vec[u8] to bytes conversion (#21357)
JukkaL Apr 28, 2026
7caa629
[mypyc] Add buffer protocol support for vec (#21359)
JukkaL Apr 28, 2026
3a0207b
Add test for new walrus semantics allowed in Python 3.12 (#21351)
hauntsaninja Apr 28, 2026
e2a9691
[mypyc] Refactor: use helper functions for vec growth (#21361)
JukkaL Apr 29, 2026
f91a89f
Bump ast-serialize again to get platform assert fix (#21371)
ilevkivskyi Apr 29, 2026
f60d40b
[mypyc] Document librt.time (#21372)
JukkaL Apr 29, 2026
aa0de5d
[mypyc] Fix debug warnings/assertions from vecs (#21373)
p-sawicki Apr 29, 2026
6267911
[mypyc] Document librt.strings (#21374)
JukkaL Apr 29, 2026
05742e2
Preserve gradual guarantee when narrowing Any union via equality (#21…
hauntsaninja Apr 29, 2026
ddacf23
Make new parser consistent with the old one (#21377)
ilevkivskyi Apr 30, 2026
2d08116
[mypyc] Optimize list->vec and tuple->vec conversions (#21375)
JukkaL Apr 30, 2026
07b6443
Bump ast-serialize version to 0.2.3 (#21378)
ilevkivskyi Apr 30, 2026
e8e1a63
Run semantic analysis pass one if file doesn't exsit (#21379)
ilevkivskyi Apr 30, 2026
e4605a5
[mypyc] Optimize vec->list and vec->tuple conversions (#21380)
JukkaL Apr 30, 2026
b2c28ea
Bump version to 2.1.0+dev (#21381)
JukkaL Apr 30, 2026
485f523
[mypyc] Add note about librt.strings thread safety (#21383)
JukkaL Apr 30, 2026
eb0caa1
Respect JSON output mode for syntax errors (#21386)
AA-Turner May 1, 2026
0d118cc
Bump ast-serialize version to 0.3.0 only (#21391)
ilevkivskyi May 1, 2026
9e2d061
Bump ast-serialize cache version (#21388)
ilevkivskyi May 1, 2026
7760563
Expose --num-workers and --native-parser (#21387)
ilevkivskyi May 1, 2026
dd851f5
TypeForm: Enable by default (#21262)
davidfstr May 1, 2026
0ea16df
Try fixing mypy mypyc wheels (#21392)
ilevkivskyi May 1, 2026
d091daa
Add support for configuring `--num-workers` with a env variable (#21407)
KevinRK29 May 4, 2026
0007c52
Rely on typeshed/stubs for slice typing (#21401)
ilevkivskyi May 4, 2026
b7a8bab
Fix negative narrowing for containers (#21411)
hauntsaninja May 5, 2026
e95ea81
Narrow match captures based on previous cases (#21405)
hauntsaninja May 5, 2026
472d034
Some changelog updates for 2.0 (#21413)
JukkaL May 5, 2026
bb3e497
[mypyc] Fix crash on accessing StopAsyncIteration (#21406)
p-sawicki May 5, 2026
38abf69
Bump librt to 0.10.0 (#21415)
ilevkivskyi May 5, 2026
c9a8c74
[mypyc] Add nested vec irbuild reference counting test (#21417)
JukkaL May 6, 2026
16823a1
Changelog for mypy 2.0 (#21422)
JukkaL May 6, 2026
11f945b
Sync typeshed (#21232)
github-actions[bot] May 7, 2026
e7846d9
[mypyc] Update vec value struct to have direct pointer to items (#21420)
JukkaL May 7, 2026
e80db52
[mypyc] Make compilation order with multiple files consistent (#21419)
p-sawicki May 7, 2026
1730c95
[mypyc] Add API and ABI versioning to librt.vecs (#21429)
JukkaL May 7, 2026
3f0c355
Fix crash on partial type, --allow-redefinition, and global declarati…
JukkaL May 7, 2026
4e349a7
[mypyc] Mark librt.vecs as non-experimental (#21430)
JukkaL May 7, 2026
d0b3fb3
Fix type variable with values as a supertype (#21431)
ilevkivskyi May 7, 2026
4e7ae36
[mypyc] Document librt.vecs (#21437)
JukkaL May 7, 2026
1804d87
Fix JSON output mode for syntax errors in parallel mode (#21434)
AA-Turner May 7, 2026
675b6bf
Fix broken refactor of awaitable generator patching (#21435)
ilevkivskyi May 8, 2026
02d917d
[mypyc] Add librt.random module (#21433)
JukkaL May 8, 2026
db297c5
[mypyc] Enable incremental self-compilation (#21369)
VaggelisD May 8, 2026
284a6cc
Respect file config comments for stale modules (#21444)
AA-Turner May 8, 2026
46acbe8
Start testing Python 3.15 (#21439)
cdce8p May 9, 2026
b74aae4
Bump version to 2.2.0+dev (#21451)
JukkaL May 9, 2026
971904d
Reorder librt Python.h includes (#21446)
cdce8p May 9, 2026
2b5a84d
Update test requirements (#21448)
cdce8p May 9, 2026
38b1bdf
Fix function call message change for small number of args (#21432)
sobolevn May 10, 2026
010f0a2
Fix nondeterminism from nonassociativity of overload joins (#21455)
hauntsaninja May 10, 2026
06e48a0
(minor) Small simplifications in combine_function_signatures (#19196)
victorletichevsky May 10, 2026
b199f90
Analyse typeddict decorators (#21267)
pranavmanglik May 10, 2026
82fb613
Fix formatting in `error_code_list2.rst` (#21457)
sobolevn May 10, 2026
492c9aa
Bump librt version to 0.11.0 (#21458)
ilevkivskyi May 10, 2026
c0cced3
typeform: remove a regex call, rearrange checks (#21459)
JelleZijlstra May 10, 2026
a900831
Improve negative narrowing for membership checks on tuples (#21456)
hauntsaninja May 11, 2026
67cdcc3
[mypyc] Document librt.random (#21463)
JukkaL May 11, 2026
e53693b
Add changelog for mypy 2.1 (#21464)
JukkaL May 11, 2026
d62a508
Fix crash on Unpack used without arguments in class bases (#21470)
SAY-5 May 12, 2026
db331b4
[mypyc] Fix reference leak in mypyc bytes concatenation (#21469)
colinxu2020 May 13, 2026
d2b0234
Narrow membership in statically known containers (#21461)
hauntsaninja May 13, 2026
9b4e31c
docs: fix duplicated word in overload docs (#21482)
lphuc2250gma May 13, 2026
d7f7036
[mypyc] Add `librt.strings.isspace` char primitive (#21462)
VaggelisD May 14, 2026
e159ee9
Ignore num_workers in the daemon while it is not supported (#21483)
ilevkivskyi May 14, 2026
e271793
Bump ast-serialize to 0.4.0 (#21487)
ilevkivskyi May 14, 2026
1bbd6da
Describe our LLM stance in CONTRIBUTING.md (#21488)
ilevkivskyi May 16, 2026
1100800
[mypyc] Document free threading and other doc updates (#21494)
JukkaL May 16, 2026
488a646
Bump ast-serialize to 0.5.0 (#21501)
ilevkivskyi May 17, 2026
d9f17fb
[mypyc] Add `librt.strings.isdigit` codepoint primitive (#21504)
VaggelisD May 18, 2026
93eff83
Use explicit Never for type inference (#21497)
ilevkivskyi May 18, 2026
739a652
[mypyc] Add `librt.strings.isalnum` codepoint primitive (#21509)
VaggelisD May 19, 2026
5e0c274
[mypyc] Fix cross-group call to inherited __mypyc_defaults_setup (#21…
georgesittas May 19, 2026
d23f5f0
Fix false positive "Expected TypedDict key to be string literal" for …
JiwaniZakir May 19, 2026
b44b2ca
Special-case constructor for tuple types (#21502)
ilevkivskyi May 19, 2026
3a969d1
Fix crash for empty Annotated type application (#21503)
cyphercodes May 20, 2026
9b96cbe
Fix edge cases in variadic tuple subclasses (#21518)
ilevkivskyi May 20, 2026
a9d2d14
[mypyc] Add `librt.strings.isalpha` codepoint primitive (#21521)
VaggelisD May 20, 2026
ab8e4bf
[mypyc] Fix missing cross-group header deps in incremental builds (#2…
georgesittas May 20, 2026
e76418a
Merge upstream/master into release-1.20 to sync with python/mypy
georgesittas May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check documentation build

on:
workflow_dispatch:
push:
branches: [main, master, 'release*']
tags: ['*']
pull_request:
paths:
- 'docs/**'
# We now have a docs check that fails if any error codes don't have documentation,
# so it's important to do the docs build on all PRs touching mypy/errorcodes.py
# in case somebody's adding a new error code without any docs
- 'mypy/errorcodes.py'
# Part of the documentation is automatically generated from the options
# definitions in mypy/main.py
- 'mypy/main.py'
- 'mypyc/doc/**'
- '**/*.rst'
- '**/*.md'
- CREDITS
- LICENSE

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
TOXENV: docs
TOX_SKIP_MISSING_INTERPRETERS: False
VERIFY_MYPY_ERROR_CODES: 1
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install tox
run: pip install tox==4.53.1
- name: Setup tox environment
run: tox run -e ${{ env.TOXENV }} --notest
- name: Test
run: tox run -e ${{ env.TOXENV }} --skip-pkg-install
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ jobs:
toxenv: py
tox_extra_args: "-n 4"
test_mypyc: true
- name: Test suite with py315-ubuntu, mypyc-compiled
python: '3.15'
os: ubuntu-24.04-arm
toxenv: py
tox_extra_args: "-n 4"
test_mypyc: true
- name: Test suite with py314t-ubuntu, mypyc-compiled
python: '3.14t'
os: ubuntu-24.04-arm
Expand Down Expand Up @@ -138,6 +144,7 @@ jobs:
timeout-minutes: 60
env:
TOX_SKIP_MISSING_INTERPRETERS: False
VIRTUALENV_SYSTEM_SITE_PACKAGES: ${{ matrix.test_mypyc && 1 || 0 }}
# Rich (pip) -- Disable color for windows + pytest
FORCE_COLOR: ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
# Tox
Expand Down Expand Up @@ -194,6 +201,7 @@ jobs:
if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
with:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: Install tox
run: |
Expand All @@ -204,12 +212,14 @@ jobs:
echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
pip install tox==4.26.0
pip install tox==4.53.1

- name: Compiled with mypyc
if: ${{ matrix.test_mypyc }}
# Use local version of librt during self-compilation in tests.
run: |
pip install -r test-requirements.txt
pip install -U mypyc/lib-rt
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .

- name: Setup tox environment
Expand Down Expand Up @@ -267,7 +277,7 @@ jobs:
default: 3.11.1
command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
- name: Install tox
run: pip install tox==4.26.0
run: pip install tox==4.53.1
- name: Setup tox environment
run: tox run -e py --notest
- name: Test
Expand Down
9,896 changes: 5,125 additions & 4,771 deletions CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ tox -e dev --override testenv:dev.allowlist_externals+=env -- env # inspect the
If you don't already have `tox` installed, you can use a virtual environment as
described above to install `tox` via `pip` (e.g., ``python -m pip install tox``).

## LLM-assisted contributions

In general, mypy takes a neutral stance on using various LLM code assistants to
make contributions. LLMs are just another tool, and contributors bear full
responsibility for the code they are submitting. Disclosing the use of LLMs in
pull request description is recommended, but not required.

However, we discourage use of LLMs by *new* contributors. We are interested in
growing long-term contributors who have good understanding of mypy code.
Pull requests from new contributors that are mostly generated by LLMs
with little human input will be closed.

## First time contributors

If you're looking for things to help with, browse our [issue tracker](https://github.com/python/mypy/issues)!
Expand Down
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
prune mypy/typeshed
include mypy/typeshed/LICENSE
include mypy/typeshed/stdlib/VERSIONS
include mypy/typeshed/stdlib/_typeshed/README.md
recursive-include mypy/typeshed *.pyi

# mypy and mypyc
Expand Down Expand Up @@ -46,8 +47,8 @@ include conftest.py
include runtests.py
include tox.ini

include LICENSE mypyc/README.md CHANGELOG.md
exclude .gitmodules CONTRIBUTING.md CREDITS ROADMAP.md action.yml .editorconfig
include LICENSE mypyc/README.md CHANGELOG.md CREDITS
exclude .gitmodules CONTRIBUTING.md ROADMAP.md action.yml .editorconfig
exclude .git-blame-ignore-revs .pre-commit-config.yaml

global-exclude *.py[cod]
Expand Down
23 changes: 4 additions & 19 deletions docs/source/builtin_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ See :ref:`dynamic-typing` for more details.
Generic types
.............

In Python 3.9 and later, built-in collection type objects support
indexing:
Built-in collection type objects support indexing:

====================== ===============================
Type Description
Expand All @@ -65,13 +64,11 @@ strings and ``dict[Any, Any]`` is a dictionary of dynamically typed
Python protocols. For example, a ``str`` object or a ``list[str]`` object is
valid when ``Iterable[str]`` or ``Sequence[str]`` is expected.
You can import them from :py:mod:`collections.abc` instead of importing from
:py:mod:`typing` in Python 3.9.
:py:mod:`typing`.

See :ref:`generic-builtins` for more details, including how you can
use these in annotations also in Python 3.7 and 3.8.
See :ref:`generic-builtins` for more details.

These legacy types defined in :py:mod:`typing` are needed if you need to support
Python 3.8 and earlier:
These legacy types defined in :py:mod:`typing` are also supported:

====================== ===============================
Type Description
Expand All @@ -80,17 +77,5 @@ Type Description
``Tuple[int, int]`` tuple of two ``int`` objects (``Tuple[()]`` is the empty tuple)
``Tuple[int, ...]`` tuple of an arbitrary number of ``int`` objects
``Dict[str, int]`` dictionary from ``str`` keys to ``int`` values
``Iterable[int]`` iterable object containing ints
``Sequence[bool]`` sequence of booleans (read-only)
``Mapping[str, int]`` mapping from ``str`` keys to ``int`` values (read-only)
``Type[C]`` type object of ``C`` (``C`` is a class/type variable/union of types)
====================== ===============================

``List`` is an alias for the built-in type ``list`` that supports
indexing (and similarly for ``dict``/``Dict`` and
``tuple``/``Tuple``).

Note that even though ``Iterable``, ``Sequence`` and ``Mapping`` look
similar to abstract base classes defined in :py:mod:`collections.abc`
(formerly ``collections``), they are not identical, since the latter
don't support indexing prior to Python 3.9.
17 changes: 8 additions & 9 deletions docs/source/cheat_sheet_py3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ Useful built-in types
x: str = "test"
x: bytes = b"test"

# For collections on Python 3.9+, the type of the collection item is in brackets
# For collections, the type of the collection item is in brackets
x: list[int] = [1]
x: set[int] = {6, 7}

# For mappings, we need the types of both keys and values
x: dict[str, float] = {"field": 2.0} # Python 3.9+
x: dict[str, float] = {"field": 2.0}

# For tuples of fixed size, we specify the types of all the elements
x: tuple[int, str, float] = (3, "yes", 7.5) # Python 3.9+
x: tuple[int, str, float] = (3, "yes", 7.5)

# For tuples of variable size, we use one type and ellipsis
x: tuple[int, ...] = (1, 2, 3) # Python 3.9+
x: tuple[int, ...] = (1, 2, 3)

# On Python 3.8 and earlier, the name of the collection type is
# capitalized, and the type is imported from the 'typing' module
Expand All @@ -67,13 +67,12 @@ Useful built-in types

from typing import Union, Optional

# On Python 3.10+, use the | operator when something could be one of a few types
x: list[int | str] = [3, 5, "test", "fun"] # Python 3.10+
# On earlier versions, use Union
# Use the | operator when something could be one of a few types
x: list[int | str] = [3, 5, "test", "fun"]
# Union is equivalent
x: list[Union[int, str]] = [3, 5, "test", "fun"]

# Use X | None for a value that could be None on Python 3.10+
# Use Optional[X] on 3.9 and earlier; Optional[X] is the same as 'X | None'
# Use X | None for a value that could be None; Optional[X] is the same as X | None
x: str | None = "something" if some_condition() else None
if x is not None:
# Mypy understands x won't be None here because of the if-statement
Expand Down
Loading
Loading