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

Fix typos (#12495)

Found via `codespell -q 3 -S ./mypyc/external/googletest -L alo,ans,asend,ba,bre,dne,fo,haa,ist,...

909ec85c5d9dea50ec137d183b6975e55c7190c1 authored almost 3 years ago by luzpaz <[email protected]>
Remove an unused AnyStr import

7b2f86111473a32a753e46a74c954c64cbc3dccb authored almost 3 years ago by Kevin Mai-Husan Chia <[email protected]>
propertize Callable attributes before freezing dataclasses (#12383)

Co-authored-by: Jelle Zijlstra <[email protected]>

a33d2353a81d075850a487f3913720037f2473aa authored almost 3 years ago by Jordan Speicher <[email protected]>
Fix typo in checkpattern.py (#12484)

lenght -> length

b7d74f3e202fa60ff0d8a2efc299913aad68e2ed authored almost 3 years ago by Ikko Ashimine <[email protected]>
Recognise both `attrs` and `attr` package names in the plugin (#12469)

Recognise new 'attrs' package name in the attrs plugin

433544bf6f8b886f5f364e3a8de4cc1c0eb43da9 authored almost 3 years ago by Spencer Brown <[email protected]>
Unify a codepath in typevarlike semanal (#12480)

7ac5a1993f28d4a3ef8b7c7fbc541fc4210e5414 authored almost 3 years ago by jhance <[email protected]>
Remove the * for inferred types from reveal_type output (#12459)

Closes #10076

bd530392cdbe444c63cc21820ad7b9748ea9c816 authored almost 3 years ago by Stanislav K <[email protected]>
Fix Windows test failures in CI (#12477)

Allow extension file names such as `native.pyd` in addition to
`native.<python-version>.<ext>`....

a66cb498ed6bd8b582ccc9e88c89cef332ef8245 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Use more accurate flags with msvc (#12468)

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

466be215e431ddc7540840f814eed45163a141cc authored almost 3 years ago by KotlinIsland <[email protected]>
stubtest: enable verification of `__match_args__` attributes (#12465)

#12415 (included in release 0.942) unblocked typeshed from adding missing `__match_args__` attri...

ecef427dbd046a0ec7738bb06dd81bd761d104dd authored almost 3 years ago by Alex Waygood <[email protected]>
stubgen: Do not consider nested generators (#12463)

Since yields in nested functions will not yield outside of the
considered function, they can be...

1480344cfc99ed0396c2b9b9f36c14b253f440b4 authored almost 3 years ago by Štěpán Horáček <[email protected]>
[mypyc] Simplify generated code for native attribute get (#11978)

The implementation merges consecutive GetAttr and Branch ops.

The main benefit is that this m...

c7559283995ea020afbb82d92cad538f0b174913 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
stubgen: Use _typeshed.Incomplete instead of typing.Any (#12449)

Since python/typeshed#7535, typeshed has a new type `_typeshed.Incomplete`,
intended to mark fi...

82bc8df22dd1b5feea97f91dff7d91aef41dc767 authored almost 3 years ago by Sebastian Rittau <[email protected]>
testcmdline: Sync assumption about error message for Python 3.10.3 (#12452)

Python 3.10.3 is more correct about syntax error for
`mypy` test case `testBlocker`.

See htt...

6b0e8485ac20a15fb7ad8762e14315c9e9bdc349 authored almost 3 years ago by Stanislav Levin <[email protected]>
mypy_primer: fix comment workflow (#12443)

Co-authored-by: hauntsaninja <>

aa7c170b4ad31bada4faea003f9f0cb99bb58b25 authored almost 3 years ago by Shantanu <[email protected]>
Use Furo theme for documentation (#12348)

Current readthedoc theme cannot fully utilize the width of browser especially
when you are usi...

fec532028dcb7def7af4356e529fffb38c4afcea authored almost 3 years ago by 97littleleaf11 <[email protected]>
Let overload item have a wider return type than implementation (#12435)

A wider return type can be useful if a decorator used for the overload
implementation gets a mo...

1772a4cc3ed5290efa95cde2c8246db183781201 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Recognize `Hashable` as a real protocol (#11802)

When this piece of code was checked:

```python
from typing import Awaitable, Hashable, Union...

a78e60cc13daefda009c56ea10207fd3a75900ea authored almost 3 years ago by Nikita Sobolev <[email protected]>
semanal: Check that async for/with is inside an async function (#12418)

* semanal: Disallow async for/with in non-async functions

* Fix invalid async syntax in test

fa9921a49dfc5982e221af474b05191160a7f763 authored almost 3 years ago by Štěpán Horáček <[email protected]>
Pin the version of bugbear (#12436)

3751e382dd3474b75fb4cdfc4f255e433aef555d authored almost 3 years ago by jhance <[email protected]>
Make order of processing the builtins SCC predictable (#12431)

Various things can go wrong if the order of modules in the builtins
SCC that also includes typi...

fd8a15e1abdd2bb4f75c3a6319ebfba233e1fe8e authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Implement close method for generators

efe9a31f65f0204d674ea761b58b640fb7031248 authored almost 3 years ago by Max Shvets <[email protected]>
Fix inheritance false positives with dataclasses/attrs (#12411)

Multiple inheritance from dataclasses and attrs classes works at runtime,
so don't complain abo...

e0f16ed027ff7bcd30d9a4dffebe95c101447b8d authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Support overriding dunder attributes in Enum subclass (#12138)

Allows any dunder (`__name__`) attributes except `__members__` (due to it being
read-only) to ...

9551b93d843ec958b7ce35e957c42d392fc0697e authored almost 3 years ago by Petter Friberg <[email protected]>
Fix crash in match statement if class name is undefined (#12417)

Fixes #12416.

b814ae15aa1897f22e4d1783439aa39fc8c92f4c authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Allow non-final __match_args__ and overriding (#12415)

Allow subclasses to override `__match_args__` freely, and don't require
`__match_args__` to be ...

718b50eeb872517467fe244992b0cf93d64a92e0 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Fix: Empty reveal locals ouput (#12400)

Fixes https://github.com/python/mypy/issues/12388

Co-authored-by: Cibin Mathew <cibinmathew@u...

49825a9057d8c52603e91f6b99e4de94ca3d8a66 authored almost 3 years ago by Cibin Mathew <[email protected]>
readme: add pypi badges

aabbf471f929cf1540fbe46828b11a4fe4c764b3 authored almost 3 years ago by KotlinIsland <[email protected]>
mypy_primer: mention if output is truncated (#12419)

Co-authored-by: hauntsaninja <>

4de80616b8dd1392bb8dea04eb7c32b57a93e64d authored almost 3 years ago by Shantanu <[email protected]>
stubtest: error for read-only property at runtime, but not in stub (#12291)

27938e7007595584192573f80ab8977a534431f0 authored almost 3 years ago by Alex Waygood <[email protected]>
Remove Python 2 test (#12412)

This has been failing locally for me, and since Python 2 is EOL, I
don't want to figure out how...

47b9f5e2f65d54d3187cbe0719f9619bf608a126 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
find_sources: fix lint (#12403)

flake8-bugbear released a new version with new checks.
SourceFinder is small (and we don't have...

8427df1630d434ea7e8778f876a0af024b696c69 authored almost 3 years ago by Shantanu <[email protected]>
Fix caching of PEP 561 namespace packages with missing submodules (#12250)

Fixes #12232

Another "fail every 2nd run" bug

`if not self.is_module(sub_id):`, the parent...

abab1cd84f002894022da513075ab6d4cf82b065 authored almost 3 years ago by Shantanu <[email protected]>
dmypy: warn instead of failing if report generation is configured (#10181)

### Description
Log a warning instead of failing when `dmypy run` is called on a project that h...

8d02b47e179722ef421ed7caa983da7d1f219153 authored almost 3 years ago by Nate McMaster <[email protected]>
Remove NBSP from test case (#12380)

This fixes a test case, the test case included a NBSP which
resulted in the test being complete...

8c8d169565a0b7cd692997a2cf3a689dbff1ffbe authored almost 3 years ago by KotlinIsland <[email protected]>
Add success msg for only notes output (#12306)

fd905502e8d94ae6a97e5120aeb687b4a59516eb authored almost 3 years ago by 97littleleaf11 <[email protected]>
stubgen: fix handling of Protocol and add testcase (#12129)

### Description

This PR fixes #12072 by correctly handling `Protocol` definitions. Previously...

21d957afc6241c57eaa364c70920e3927ff94fdd authored almost 3 years ago by citruz <[email protected]>
Add UnpackType type and basic semanal (#12367)

Adds very basic support for Unpack expressions (where Unpack
is either from typing or typing_ex...

aa0d18638bdde631e0fe542e839a7df2dd04ba79 authored almost 3 years ago by jhance <[email protected]>
Add ``type`` to both lists of generic types (#10985) (#12351)

Updates documentation for both builtin generic types and `typing`
generic types to include `ty...

e639cfd7778115084cb437b0d26d66e6cb1bc4f4 authored almost 3 years ago by mixed-source <[email protected]>
Correct example in `runtime_troubles.rst` (#12356)

`SupportsLessThan` was removed from `_typeshed` in
https://github.com/python/typeshed/pull/658...

b09683cb33ab28b34011acb367161309a1e9af5d authored almost 3 years ago by Alex Waygood <[email protected]>
Typeshed cherry-pick: Use import instead of type alias in `email/message.pyi` (#7022) (#12340)

Co-authored-by: Chris Rose <[email protected]>

91357952db51a2d7f1c72dd5cc04f0fcb58c9248 authored almost 3 years ago by Chris Rose <[email protected]>
Fix `__annotations__` being undefined (#10969)

f9dadb13daca61bdf7972c95c36071956e7d3b43 authored almost 3 years ago by Niklas Gustafsson <[email protected]>
Add missing `enable_error_code` to config doc (#12346)

This PR adds enable_error_code to the configuration documentation,
with a description similar ...

61b621b0b00d1943ebd6cf81d8ca32d4ba1a3fd0 authored almost 3 years ago by Mathieu Kniewallner <[email protected]>
Fix small conditional overload regression (#12336)

Don't merge conditional FuncDef
after an unconditional one.

0fecec8c72605ec7bae343b28d545c477c726e81 authored almost 3 years ago by Marc Mueller <[email protected]>
Revert "Support MYPY_VERSION for overriding version" (#12333)

This reverts commit 3a5b2a996af8e0333e5eebbdbadc9eec3d1f310e.

7ee84c71e851ce373d1824ecc09332caa373148c authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
mypyc: Fix overflow in id function (CPyTagged_Id) (#12332)

In CPython, the id of an object is its address. It's computed by
converting the pointer to an u...

1a0a49ae23e4e496ff996b8ab791d82d9334f06b authored almost 3 years ago by Ekin Dursun <[email protected]>
Error on unused awaitable expressions (#12279)

Generates an error when an expression has a type which has a
defined __await__ in its MRO but i...

536bac07a52fc57fcd76ddbde210347b36e88d1e authored almost 3 years ago by jhance <[email protected]>
Support MYPY_VERSION for overriding version

3a5b2a996af8e0333e5eebbdbadc9eec3d1f310e authored almost 3 years ago by Jared Hance <[email protected]>
Minor documentation updates (#12329)

* Some minor documentation updates
* Add more discussion of exhaustiveness checking
* Update d...

0d38613d8bd156a793a2f9f0f8f331499ad31531 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Update copyright in LICENSE (#12330)

3024b3291d4317576f6d689e262d5e1eb1be17f7 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Fixes for typeshed changes (#12323)

Co-authored-by: hauntsaninja <>

504779b8511b36880df13476b4fbb35a6625743f authored almost 3 years ago by Shantanu <[email protected]>
Print compilation status with --version (#12318)

Resolves #12317

Co-authored-by: hauntsaninja <>

4a744b35e28277e2193feb78de90d3b3cbb3169b authored almost 3 years ago by Shantanu <[email protected]>
Fix proper_plugin for typeshed tuple change (#12319)

This will be broken by https://github.com/python/typeshed/pull/7454

Co-authored-by: hauntsani...

47e2ca8f54a0f72596e429c820cd9674a215f827 authored almost 3 years ago by Shantanu <[email protected]>
Update version to 0.950+dev (#12309)

18c32da8459632c746be597cd03f891d566f85d1 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Use tomllib on Python 3.11 (#12305)

5d82d5b98098ba639c517dd9dfc7273704b1e761 authored almost 3 years ago by Shantanu <[email protected]>
stubgen: fix non default keyword-only argument positioning (#12303)

Fixes #11082

8650f5c2eedc26f11b6f5c35cf0c0d752aaf51fb authored almost 3 years ago by Štěpán Horáček <[email protected]>
Exhaustiveness checking for match statements (#12267)

Closes #12010.

Mypy can now detect if a match statement covers all the possible values.
Exam...

226661f62f365102f5fd913b39b32ed3f12e208b authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
CI: Do not run mypy_primer on stubtest/stubgen PRs (#12295)

PRs that only affect stubtest or stubgen are never going to have any effect on mypy_primer's out...

fce1b548be74f7c65f8e3645f2a2b46aeff0c5a8 authored almost 3 years ago by Alex Waygood <[email protected]>
stubtest: ignore more dunder positional-only errors (#12294)

This isn't actually a reversion. This logic was asymmetrical for reasons
lost to time. Although...

c7a81620bef7585cca6905861bb7ef34ec12da2f authored almost 3 years ago by Shantanu <[email protected]>
Revert "stubtest pos-only differences in dunders (#12184)" (#12293)

This reverts commit 777885f2c26cce195f6d23c80fefae1e66dfaac2.

To help with https://github.com...

b3752a60af3f8e6a1b17c4ebc90ed554cb934288 authored almost 3 years ago by Shantanu <[email protected]>
teststubtest: further fix tests (#12287)

Basically a follow up to #12282

Co-authored-by: hauntsaninja <>

4d99f7c6ee5bcae4eedb041106943cf29b58ceb3 authored almost 3 years ago by Shantanu <[email protected]>
stubtest: Fix wrong assumption about relative path (#12282)

Fixes https://github.com/python/mypy/issues/11019

`run_stubtest` creates temp directory and p...

a562f0aac287b1069a8267b3812fb6813eaefec3 authored almost 3 years ago by Stanislav Levin <[email protected]>
Small doc improvements for conditional overloads (#12283)

73a5b3c2d0224d7d3bfe094309552f6c5c60c6cb authored almost 3 years ago by Marc Mueller <[email protected]>
Add support for conditionally defined overloads (#10712)

### Description

This PR allows users to define overloads conditionally, e.g., based on the Py...

0777c1006c2307f4a3d1cc87462b13cbd2a85435 authored almost 3 years ago by Marc Mueller <[email protected]>
Support universal2 (#10651)

68b3b27c2fc47cc01f16d98e7e7d944ad5c0c6be authored almost 3 years ago by 97littleleaf11 <[email protected]>
Remove test case for TypedDict with kwargs (#12273)

7b4d72596fadb9da28a932f044834fa07e885668 authored almost 3 years ago by 97littleleaf11 <[email protected]>
Improve the "Argument must be a mapping" error message (#12222)

Fixes #12070

26bfc631c1cd25a874cce21c0b08df5e7d939edb authored almost 3 years ago by Purna Chandra Mansingh <[email protected]>
Remove orjson stubs from default list (#12264)

See https://github.com/python/typeshed/issues/5863

Co-authored-by: hauntsaninja <>

187f39461df068766a3129fa99ac376fc5a7143b authored almost 3 years ago by Shantanu <[email protected]>
Fix enum regression #12258 (#12260)

Closes #12258
Closes #12262

feab20938d8e0ac66c4d3b270c26f9e9545eb63f authored almost 3 years ago by Nikita Sobolev <[email protected]>
stubtest: do not error if a stub is async, but runtime is not (#12234)

e7846480501d816f938f82932f937683621247b9 authored almost 3 years ago by Alex Waygood <[email protected]>
renaming: minor comment tweaks (#12255)

feca706d5f2540003ae8b24009d56dac7c067eba authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Give "as" variables in with statements separate scopes (#12254)

Use renaming to allow two with statements to define the same variable
using incompatible types....

ea933268427737976ef819ea3fff0599264e3d5b authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Use `__truediv__` for python2 with `__future__` import, refs #11740 (#11787)

Now `__future__` imports do not leak in semanal.py.

Closes #11740
Refs #11741
Refs #11276
...

14de8c6f1f24648299528881561ddcd52172701d authored almost 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Improve comments and docstrings in tests (#12223)

Tests for multi-file and separate compilation modes are a bit
special, and it seems useful to h...

115ac31fd42c5dcbb0ea4b0e9713e7a33c1418cc authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Make pyinfo compatible with Python 2 (#12244)

I'm not adding a test because it's Python 2, but I did test locally.

Co-authored-by: hauntsan...

a3fc35a10dbf8158e1e989787202ab6c7b1766d1 authored almost 3 years ago by Shantanu <[email protected]>
Update `Enum` docs (#12238)

After merging https://github.com/python/mypy/pull/11805 I found out that we are missing several ...

fa3adbd462eb1be64c4417d75319c632324e821c authored almost 3 years ago by Nikita Sobolev <[email protected]>
Use type variable bound to infer constraints (#12230)

This fixes a regression where `iter(x)` could generate a false
positive if `x` has a type varia...

65ac27050149126469e006954a6ae5a0c5359ea8 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Typeshed cherry-pick: Use `int | Any` for `types.FrameType.f_lineno` (#6935) (#12240)

This fixes some regressions.

eca4c300111a8c12e402acbada35badbd3c705f8 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Typeshed cherry-pick: Replace some literal types in logging with int (#7354) (#12239)

Fixes some regressions.

Context: python/typeshed#7258

bb1fda39eb4a9cf370086987760e4dc113b8b859 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Use Py_TYPE and Py_IsNone (#12233)

784b67ec0b1daa42c128396f247987bb0c80a3d3 authored almost 3 years ago by 97littleleaf11 <[email protected]>
Adds docs about `Enum` type (#11805)

* Adds docs about `Enum` type

* Better structure

bd37ab895f15b5ad04586d14155ebb14aceeb1eb authored almost 3 years ago by Nikita Sobolev <[email protected]>
Handle `raise Exception(), None` on Python2.7 (#11786)

Closes #11742
Related #11743
Related #11289
Related #11700

7143424750280a476e9cdcaaa1bb6050c84bd534 authored almost 3 years ago by Nikita Sobolev <[email protected]>
Typeshed cherry-pick: Improve signature of overlaps in ipaddress (#7260) (#12236)

This fixes a minor regression.

8157a6f65bf7fec004b5cc7b3ea01f8cf2b420e8 authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Check `Enum` definition for invalid base classes (#12026)

Closes #11948

1321e9e78dda815e14d16338f01903b449379bdd authored almost 3 years ago by Nikita Sobolev <[email protected]>
Fix inference of protocol against overloaded function (#12227)

We used to infer a callable in a protocol against all overload
items. This could result in inco...

a8b6d6f74cef7a2435f69fc8cdb33cf43fc4a8ac authored almost 3 years ago by Jukka Lehtosalo <[email protected]>
Sync pythoncapi_compat (#12188)

2c9a8e731785fac1d1ef342863b70854de16423a authored almost 3 years ago by 97littleleaf11 <[email protected]>
Fix one invalid reference inside visit_class_pattern (#12229)

2d30dbaa34eab9d7519e440480f360fc9a1e65c3 authored almost 3 years ago by 97littleleaf11 <[email protected]>
BUG: Fix an `issubclass` failure for protocols with overloaded methods (#9904)

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

b22c4e4a2e9f56480724a45e159552c922af47dc authored almost 3 years ago by Bas van Beek <[email protected]>
Update dev-intro.md

Add a link to Python doc about Python C API, which is a friendly tutorial for beginners.

66982637944451401a88edc95be1fed6f3a87baa authored almost 3 years ago by 97littleleaf11 <[email protected]>
Coalesce Literals when printing Unions (#12205)

Instead of printing `Union[Literal[X], Literal[Y]]`, these are now
printed as `Literal[X, Y]`.

68b208d0a8a7e24bfa2c7ed816625381ce9e6fde authored almost 3 years ago by Marti Raudsepp <[email protected]>
[mypyc] Refactor: Use WrapperGenerator for generate_wrapper_core (#12209)

The WrapperGenerator is an abstract class for wrapper generation,
originally from generate_wra...

a72689265348a00216b90de966cd5a54f1d97093 authored almost 3 years ago by 97littleleaf11 <[email protected]>
stubtest: catch more getattr errors (#12219)

Fixes for https://github.com/python/typeshed/issues/7307
Amusingly, the evil runtime module tha...

608f2749b8b4c5bf361ccd657b492c343a9f9851 authored almost 3 years ago by Shantanu <[email protected]>
stubtest: error if module level dunder is missing, housekeeping (#12217)

Basically a follow up to #12203

New errors in typeshed from this:
```
_decimal.__libmpdec_v...

58514a9cf2643da8b74bc5bce4be6d2c201b40e5 authored almost 3 years ago by Shantanu <[email protected]>
stubtest: ignore __main__ module (#12218)

Co-authored-by: hauntsaninja <>

f98881cbdf516484fbee30c38ace8d7acdd5ffaf authored almost 3 years ago by Shantanu <[email protected]>
stubtest: error if a dunder method is missing from a stub (#12203)

9af578d796564617fc5d110b66e84087e23c41ea authored almost 3 years ago by Alex Waygood <[email protected]>
Tweak ignore-without-code error message (#12216)

36d50d68ba350ebd167a604a2bb3906ac720911f authored almost 3 years ago by Marc Mueller <[email protected]>
stubtest: error if a function is async at runtime but not in the stub (and vice versa) (#12212)

85fc99c99e7e2afc5896de1842d52e6e6cd55197 authored almost 3 years ago by Alex Waygood <[email protected]>
[mypyc] Implement additional ircheck checks (#12191)

* Implement more checks in ircheck

Check op/register validity and check type coercions for re...

c7365efceb24587c9b71066c360e167bcdce536a authored almost 3 years ago by jhance <[email protected]>
Suggest `typing.Callable` when using `callable` as type (#12204)

d02db50c3f187871545b1a560a2d93fffcb53e7e authored almost 3 years ago by Tuomas Siipola <[email protected]>
Fix more crashes in class scoped imports (#12199)

Fixes #12197

This essentially walks back changes in #12023 that apply to
function-like thing...

31586774b7f801cb185c866f35e954c4ef6ffd55 authored almost 3 years ago by Shantanu <[email protected]>