Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/python/mypy

Optional static typing for Python
https://github.com/python/mypy

Fixes type vars semanal with `ParamSpec` (#11220)

Closes #11218

Co-authored-by: Shantanu <[email protected]>

032f3b616854c54cd7903f68fd55ff73a7907884 authored over 3 years ago by Nikita Sobolev <[email protected]>
Add `__slots__` to all types and nodes (#11197)

Quick review of changes:

* I had to move all class-level values into self. definitions, becau...

7f89cf8f98efff53de267dd28a8002f99f172a84 authored over 3 years ago by Nikita Sobolev <[email protected]>
Rename builtin_type to named_type (#11224)

Currently TypeChecker.named_type is been called inside
MemberContext.builtin_type thus this PR...

bffeb2e6766fd559d0888886c2d2374f42fa42b5 authored over 3 years ago by 97littleleaf11 <[email protected]>
Remove duplicate import in mypy/messages.py (#11235)

1d040591d4772b0ecd5ab8bb47c07e389041512c authored over 3 years ago by Daniel Mendelsohn <[email protected]>
Checks `Instance` and `Literal` subtypes correctly, refs #11232 (#11236)

Closes #11232
Closes #7399

967f5904caa7caef17d1e14015f9a4d643deb189 authored over 3 years ago by Nikita Sobolev <[email protected]>
Removes unused `mypyc` imports (#11237)

ed0cc78a5cbdfcb9724cf1f294f7b5cbbd1d6778 authored over 3 years ago by Nikita Sobolev <[email protected]>
Fixes error message for `f` string and `str-bytes-safe` (#11139)

It does not mention `.format()` anymore.

Closes #10979

209a7193feb4bbfa38d09232b0a5a916e9d2e605 authored over 3 years ago by Nikita Sobolev <[email protected]>
Now `lambda` is counted as a valid context in `handle_cannot_determine_type` (#11215)

Closes #11212

Previously `mypy` was ignoring `lambda` scope in `handle_cannot_determine_type`...

d37c2be0f7a2002a0a8c160622d937518f902cc7 authored over 3 years ago by Nikita Sobolev <[email protected]>
Now `lambda` inherits typed context in `semanal.py` (#11213)

Closes #11155

e0b4b05b8aafa328942b84233756a64be4950e1a authored over 3 years ago by Nikita Sobolev <[email protected]>
Improve type narrowing for walrus operator in conditional statements (#11202)

Authored-by: @kprzybyla <>

8e82171a3e68a5180fab267cad4d2b7cfa1f5cdc authored over 3 years ago by Shantanu <[email protected]>
Sync typeshed, fix strict equality dict view checks (#11200)

Source commit:
https://github.com/python/typeshed/commit/a9227ed98589bf960b1c9ee2da69890171f8df...

d469295ce4f46ee7c95a7d06488ba6c9e1d1d4f4 authored over 3 years ago by Shantanu <[email protected]>
Fix error message for dataclasses.field with positional argument (#11180)

Fixes #10248

The crash due to dataclasses.field was fixed in the recent PR #11137, but the er...

3ec0284513359810bb5b149f94eec236d2e8da6c authored over 3 years ago by Hiroshi Ogawa <[email protected]>
Fix: warn unused ignores when not all specified error codes are used (#11178)

Fixes #11157

For --warn-unused-ignored, currently Errors.used_ignored_lines keeps track
of ...

8b47a032e1317fb8e3f9a818005a6b63e9bf0311 authored over 3 years ago by Hiroshi Ogawa <[email protected]>
Add type narrowing docs about `callable` (#11174)

Closes #11172

4e7c2a0e0dc69295bc3f2d93d4e34964c591d473 authored over 3 years ago by Nikita Sobolev <[email protected]>
Marks unique enums as `@unique` (#11181)

All enums in mypy are unique. Eventhough, current state of enum_plugin
does not support @uniqu...

0c1b6a210fa199b0dd0e8f5a01b4530b6d43d7e1 authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Remangle names produced by allow-redefinition (#11175)

Fixes mypyc/mypyc#702 by replacing "'" with "__redef__",
although this assumes nothing else wil...

20fa54afab7e78b76c02cb7e61f458a3d90c1393 authored over 3 years ago by jhance <[email protected]>
Add doc status badge (#11173)

I was always looking for it, but I always had to scroll further for "documentation" link.
It us...

904e4c069fcc51167977d0b7891657350d0ba6fb authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Coerce Register assignments (#11176)

Fixes mypyc/mypyc#759 and probably some other issues. Including only
the change to coerce the R...

2aebd4c23d4fc521894a964a4c8e52f377731f1d authored over 3 years ago by jhance <[email protected]>
Refactor: Use context manager for mypyc.irbuild.enter_method and mypy.semanticanalyzer.enter (#11072)

Related issue: #1184

44edc1a6242bad378fb809e12babbbc2baa54178 authored over 3 years ago by 97littleleaf11 <[email protected]>
Show all overloads in error message (#9177)

Closes #9175

579180ab26dcfdad7d576a7d704c8140da64cbd6 authored over 3 years ago by Akuli <[email protected]>
Adds better NamedTuple error messages (#11127)

While working on #11047 I've noticed that mypy reports the same error
for both collection.name...

96d724220767762ac6f1dd76573f75de1af9d94b authored over 3 years ago by Nikita Sobolev <[email protected]>
Adds `in_checked_function()` to semanal similar to the one in checker (#11156)

Refs #11155

b7d8724f5028fff5e6c1bfe86334bcdec79177dc authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Fix division of negative tagged int (#11168)

The rounding was incorrect for some negative values, because of a bug
related to the tagged int...

2f2c3771b93aeabc0eaa4a031ba81e66d43e23a4 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Remove useless return statement (#10837)

`return` (or any other statement) after a `while True` with no `break` condition
will never be...

58fb493b04c61f6202ac8ba0811d3ff8546a8e60 authored over 3 years ago by Elisha Hollander <[email protected]>
Adds docs about `:=` and `TypeGuard` (#11161)

Closes #11075

91f299edff3836df29a36a5490a21c0cfb6e0a71 authored over 3 years ago by Nikita Sobolev <[email protected]>
Fixes mypy crash on protocol with contravariant var (#11135)

Closes #11020

* Fixes mypy crash on protocol with contravariant var

* Fixes how `infer_con...

23e02e20f50255bd5b3217d224d1f9c77d85f6ce authored over 3 years ago by Nikita Sobolev <[email protected]>
Fix semantic analysis of assignment expressions (#11153)

Fixes half of #11060

Co-authored-by: hauntsaninja <>

d7bb8400e8fe48bb8a31bca6a38fef16420550bb authored over 3 years ago by Shantanu <[email protected]>
Fix mypy crash on `dataclasses.field(**unpack)` (#11137)

a7d6e68541e1c6b52338dbe2e3f4a7055a033483 authored over 3 years ago by Nikita Sobolev <[email protected]>
Detect conda gcc for -Wno-unused-but-set-variable as well (#11112)

fab534bcc74806d76dba66264490c0b3eddf39dc authored over 3 years ago by Michael R. Crusoe <[email protected]>
Adds support for `__slots__` assignment (#10864)

### Description

Fixes #10801

We can now detect assignment that are not matching defined...

8ac0dc2b87c53bbe0f0633ba80a3136390cab668 authored over 3 years ago by Nikita Sobolev <[email protected]>
Adds better type narrowing docs (#11088)

Co-authored-by: Shantanu <[email protected]>

b3ff2a683bd41a176c597d3c3ba65f6a31f805c5 authored over 3 years ago by Nikita Sobolev <[email protected]>
Correct example annotation `self` (#11133)

Add needed `covariant=True` for example to pass type checking at `page.first_chunk()` as intended.

b165e42ceed949a89cb28f5b5d0c194af1a0298f authored over 3 years ago by ryan-gunderson <[email protected]>
Report attribute access errors for TypeVar bound to Union (#11140)

b94b04c483f1109becc00f35d441f48e5695b82f authored over 3 years ago by Christoph Tyralla <[email protected]>
Document ‘strict’ config file option (#11132)

Historically --strict was only supported on the command line, but
commit cb0ceb02848494f3dab2d9...

75d417f532da3b30b015b8bfa03da3307c668777 authored over 3 years ago by Anders Kaseorg <[email protected]>
Fixes crash on partial `None` (#11134)

Closes #11105

04ff70ca604a4c63d9f7fe518a2c5bc893cc59cd authored over 3 years ago by Nikita Sobolev <[email protected]>
Fixes `misc/proper_plugin` crash on `isinstance(1)` (#11136)

836ff14af53af54295d8ccd5fc6bdd6e83e599b4 authored over 3 years ago by Nikita Sobolev <[email protected]>
Fixes TypedDict crash with function definition (#11126)

Fixes #11079

c6e8a0b74c32b99a863153dae55c3ba403a148b5 authored over 3 years ago by Nikita Sobolev <[email protected]>
Fixes `raise CustomError` creationg with `__init__` with arguments (#11125)

Fixes #11089

130ba461b3590d7f34f326fbcfd1d913089765b7 authored over 3 years ago by Nikita Sobolev <[email protected]>
Sync typeshed (#11123)

Source commit:
https://github.com/python/typeshed/commit/e4c2c0f3021abac1078854da92a9ec14848b32...

99fae38db80e2d2778c5d11e61463100342818ad authored over 3 years ago by Shantanu <[email protected]>
Don't trigger wheel builds on forks (#11124)

Co-authored-by: hauntsaninja <>

5bfdce8fc77ca76f87977c9feaf49ee4e9fcc22c authored over 3 years ago by Shantanu <[email protected]>
bpo-45122: Remove PyCode_New from mypyc (#11067)

Guido plans to remove PyCode_New from CPython CAPI.
See: https://bugs.python.org/issue45122

...

e2d8a507bac5d2652c72a4a4bc62349d865cd076 authored over 3 years ago by Dong-hee Na <[email protected]>
Remove unused variable in testpep561.py (#11114)

cc224ca26d565c6701e2e96ac76e66e2450f9d33 authored over 3 years ago by Nipunn Koorapati <[email protected]>
Fix minor grammar issue in docs (#11106)

d263a9698fb59d7a1ae0c7817ef53bb272c8d875 authored over 3 years ago by Daniel Hahler <[email protected]>
Use descriptive names in CI (#11104)

4b2d3b3fe5d51e3542786fa4274086a3c240528e authored over 3 years ago by Shantanu <[email protected]>
Fix type guard crashes (#11061)

Fixes #11007, fixes #10899, fixes #10647

Since the initial implementation of TypeGuard, there...

05f38571f1b7af46dbadaeba0f74626d3a9e07c9 authored over 3 years ago by Shantanu <[email protected]>
[stubgen] Fix a few bugs with stubgen of c modules (#11096)

* [stubgenc] Fix bug when inferring signatures with no args

* [stubgenc] Add self arg when it...

e654572fa9627f455825817699a57ee4c5dcbf0c authored over 3 years ago by Chad Dombrova <[email protected]>
Migrate tests from Travis.ci to Github Action (#11073)

Closes #11062.

3ef8040a4c9b9ad05368f593749125b4c7f8067d authored over 3 years ago by 97littleleaf11 <[email protected]>
Use property instead of method (#11068)

Closes #2112.

This PR changes the FunctionLike.items from method to property. By
doing so, ...

7b9aa4cfe2cb57fa3f90a917dcd02620986bee79 authored over 3 years ago by 97littleleaf11 <[email protected]>
Document how `--no-implicit-reexport` handles `from X import Y as Z` (#11083)

c603e13ab02b1eb33d92df9f0dee289ce4f3d413 authored over 3 years ago by Max Marrone <[email protected]>
Recognise typeshed submodules in VERSIONS (#11069)

Fixes #10483

Tested manually using importlib.metadata

Co-authored-by: hauntsaninja <>

bbea3b56297d3d966b9a98900c218df6616fec85 authored over 3 years ago by Shantanu <[email protected]>
Use context manager for Scope (#11053)

Related issue: #1184
Follows up to #10569, #10685

This PR:
* Refactors `Scope`
- Replace...

725a24a82fdf79521db5d0c43549e8731f793c55 authored over 3 years ago by 97littleleaf11 <[email protected]>
Update type narrowing section in`common_issues.rst` (#11014)

1. Changed an outdated example to an original one from https://github.com/python/typing/issues/1...

b17ae30d1efe58095c61c1731c29bcfe4dd7065c authored over 3 years ago by Nikita Sobolev <[email protected]>
error_code_list2.rst: typo + edit (#11052)

5c4aea39ab6a14eeef85cc849d6057bebf2147a3 authored over 3 years ago by Ilya Konstantinov <[email protected]>
[mypyc] Remove decorator_helper_name (#11022)

Per mypyc/mypyc#718, renaming the original function name in the module
mapping causes the __nam...

26673bea8d54ddcb4a0a52e571409c64cbf1b887 authored over 3 years ago by jhance <[email protected]>
Check expr that are implicitly true for lack dunder bool/len (#10666)

Optional check which disallows using implicitly true expressions (whose type has no __bool__ nor...

a72fab3b43b0c3ba40abfd4911ec653da5de7230 authored over 3 years ago by Ilya Konstantinov <[email protected]>
Removes unused `mypy.errors` import from `stubgen` (#11042)

That's the last unsued import I found.
Related #11041

5e73cd7b0dc9b871716acf0086b2ca0376fcff39 authored over 3 years ago by Nikita Sobolev <[email protected]>
Removes unused import (#11041)

eb198f463dc6357674ae780fd4c58865aa2ce84a authored over 3 years ago by Nikita Sobolev <[email protected]>
Sync typeshed (#11035)

Source commit:
https://github.com/python/typeshed/commit/8e0e13a2d564010c682ac14531001ca037b9a2...

3f8ada039ca3a9fdadeec98ce2560790cc579de1 authored over 3 years ago by Shantanu <[email protected]>
Support making a variable Optional in an else branch (#11002)

That is, support patterns such as:
```
if condition:
foo = Foo()
else:
foo = None
...

56b68032b4db6f4314d29467c182337f9fdda634 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Fix argument checking on empty dict with double stars (#9629)

### Description

Closes #5580
Previously, the type of empty dicts are inferred as `dict[<noth...

ea7fed1b5e1965f949525e918aa98889fb59aebf authored over 3 years ago by Momoko Hattori <[email protected]>
[mypyc] Implement bytes equality optimizations (#10928)

8c5c915a89ec0f35b3e07332c7090e62f143043e authored over 3 years ago by jhance <[email protected]>
A sketchy hack to fix TypeGuard crash in logical expressions (#11015)

Support or expressions involving type guard checks.

Co-authored-by: Ivan Levkivskyi <ilevkivs...

2a1cea4d2ce233f345e8a515d6d0d5cd38c8d1ac authored over 3 years ago by Ivan Levkivskyi <[email protected]>
Add __dataclass_fields__ and __attrs_attrs__ to dataclasses (#8578)

Fixes #6568.

7576f659d42ee271c78e69d7481b9d49517a49f6 authored over 3 years ago by Timofey Kukushkin <[email protected]>
Fix typo and indent (#10995)

fbedea5384939901102de86cf82058cf6552be8c authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Faster bytes formatting (#10989)

Speed up simple % formatting with bytes (%s and %b).

* Share the same tokenizer with string f...

f1167bc43866f6b1b663d97121e23a5cebe5f952 authored over 3 years ago by 97littleleaf11 <[email protected]>
fix doc typo (#10992)

ba540f0d2abf6aaa586e9f4b4bdb615ba2175bc9 authored over 3 years ago by sed-i <[email protected]>
Ignore associated notes with ignore[typeddict-item] (#10975)

21055322ba1c2fac99d18560124a3eed07c426df authored over 3 years ago by Mehdi ABAAKOUK <[email protected]>
[mypyc] Use native calls to singledispatch functions (#10981)

* Wrap singledispatch callable class in glue function

mypyc doesn't have support for calling ...

cd013d13e600539a6c2d7a667c95b6c4602e62ee authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Use a cache to speed up singledispatch calls (#10972)

This adds a cache to the dispatching code for singledispatch functions,
which makes calling sin...

4c90aa42e6a74f127956124aec94f55dbc46a281 authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Add primitive for bytes slicing (#10966)

Add a C helper function for bytes and bytearray slicing.

644496828841035d097d7afd80b96081e0ea5c7f authored over 3 years ago by 97littleleaf11 <[email protected]>
Add primitives for str.encode() (#10974)

3970cc3baf98dd456927accb550659beb14ea0bd authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Add primitive for bytes.decode (#10951)

Implements part of mypyc/mypyc#880.

5adb0a05c157d9f5afbdb048a6d06a3234586ab6 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Add bytes index primitive (#10950)

Implements part of mypyc/mypyc#880.

ba7b50c07886f744268d664adb5a6f026ce7be37 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Add support for dynamically registering singledispatch functions (#10968)

Instead of generating a regular native function for singledispatch
functions, generate a callab...

0dcd2c636e28d27473c084e5148e7dfb86886831 authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Use MRO of argument for dispatch in singledispatch functions (#10930)

This changes the implementation of singledispatch to look up the correct registered implementati...

0bde4b9e82e337f1b63d1e7dcc6922ed648e86f7 authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Speed up string formatting using FormatOp (#10942)

This PR speeds up FStrings using FormatOp and convert_expr.

6e48f7e18b39e5fdab594e111da133965081c728 authored over 3 years ago by 97littleleaf11 <[email protected]>
Switch to using Id functions everywhere in lib-rt and dropping format calls (#10941)

3c935bdd1332672f5daeae7f3f9a858a453333d4 authored over 3 years ago by Michael J. Sullivan <[email protected]>
[dataclasses plugin] Support kw_only=True (#10867)

Fixes #10865

ed2b4c76cb8662942096de1cfbf08aa422a3b6f2 authored over 3 years ago by Tim Gallant <[email protected]>
Fix caching behavior of PEP561-installed namespace packages (#10937)

Since PEP561-installed namespace packages only show up in
FindModuleCache as a side-effect, the...

c90026bd867635a4efe70cdacf0caaf00a986914 authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Introduce FormatOp and add a tokenizer for .format() call (#10935)

This PR adds a tokenizer that convert a str.format() format string into literals
and specifier...

58c0a051b72731f093385cc7001b1f5c2abd2c18 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Add bytes concat op (#10926)

e7161ac06d6b05f6b59669d2d0a6b9406bb112bc authored over 3 years ago by 97littleleaf11 <[email protected]>
Pin tomli to 1.1.0 (#10938)

While we figure out what the plan is in coordination with black and
pip (see #10893), just pin ...

daed963d1f849fa88875d2d6ea2775a7a9b16c2f authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Add tests for chr(), ord(), encode() and decode() (#10914)

Add several run tests:

* chr()
* ord()
* decode()
* encode()

68a67aedb072dc811424636140a87aa76f1b59bb authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Faster len(bytes) (#10936)

Similar to list and tuple, we can directly get length of bytes from
PyVarObject->ob_size.

I...

baea65a338e67a09a23158b4067b75e86de009a7 authored over 3 years ago by 97littleleaf11 <[email protected]>
Add primitive for bytes join() method (#10929)

97a1b3f81f90ebc2739773cd949b92d891f47c4d authored over 3 years ago by jhance <[email protected]>
Try removing skipped test on macOS (#10934)

This test was original skipped because nesting a virtualenv inside of a venv on macOS was a prob...

e73432162b86f901c54e87d62858b0bdde062d24 authored over 3 years ago by Ethan Smith <[email protected]>
Add an xfailed test for issue #9852 (#10932)

As part of doing this I upgraded the pep561 tests to support
incremental tests, and removed at ...

869f7b447d850f8b9607ea93e6f891954a781237 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Fix self check (#10927)

188b7d4b5cac113b05d6fbd2db7423f523cfd188 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Make the handling of ControlOp targets more generic (#10920)

Add a `targets` property and a `set_target` method to `ControlOp` to
enable generic processing....

481db723b86fc18cd1aee1456f14ab549d8df11b authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Add bytes and bytearray initialization ops (#10900)

Use `PyBytes_FromObject` for `bytes(o)`.
Use `PyByteArray_FromObject` for `bytearray(o)`.

Cu...

d991d19ed550c940a5b3634eb2c6c954e09293e0 authored over 3 years ago by 97littleleaf11 <[email protected]>
Fix test failures caused by merge race (#10925)

d7fabc91adfdb37d9d6acf48278a267243fb002a authored over 3 years ago by Shantanu <[email protected]>
Fix recursion issue with nested instances and unions (#9663)

* Fix recursion issue with nested instances and unions

* Change to use `==` in `is_protocol_i...

743815861ce9b3758de81782efc2c911c0320c92 authored over 3 years ago by Peilonrayz <[email protected]>
Sync typeshed (#10924)

Source commit:
https://github.com/python/typeshed/commit/b2e429cd41347ce48a96feaa1681726d8f77fb...

082c937149a971c5b27321bdbb4e5826ebfc2088 authored over 3 years ago by Shantanu <[email protected]>
Plugin for tuple multiplication with literal int (#10361)

14eaa1810ed92047ad5fe583065089d29043e435 authored over 3 years ago by hatal175 <[email protected]>
Fix ad hoc instance intersection logic (#9909)

Fixes #9907

So far, method `TypeChecker.intersect_instances` generally reports an unreachable...

21991cf9d5c35b959d99042892c3e6a58e7f9bfb authored over 3 years ago by Christoph Tyralla <[email protected]>
Sync typeshed (#10862)

Source commit:
https://github.com/python/typeshed/commit/581b2d518041377069e2aeee969e7b2e86270f...

d131e91804ac887d12b207d53435718cd68bc475 authored over 3 years ago by Shantanu <[email protected]>
Add __path__ to package __init__ (#9454)

Resolves #1422

Co-authored-by: hauntsaninja <>

18ff207c96a2104a645da0d958d77aad1ff5e9aa authored over 3 years ago by Shantanu <[email protected]>
Fix deserialisation of ParamSpecType (#10923)

Co-authored-by: hauntsaninja <>

7919e59a69b8301e27f1c02495f8c77d35584da9 authored over 3 years ago by Shantanu <[email protected]>
Merge TypeVarDef and TypeVarType (#9951)

In the spirit of #4814 (comment)

I'm not sure what the distinction between TypeVarDef and Typ...

2736edbbcc6273557d3e4acd5c7797dec1f7a59a authored over 3 years ago by Shantanu <[email protected]>
Make the test system marginally less hostile to external reuse (#10919)

We currently assert that test-data is present in `mypy.test.config`;
delay that until we actual...

3e5b9b110c4405d533678b6fc4d8bae06e22e3db authored over 3 years ago by Michael J. Sullivan <[email protected]>