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

Turn on ParamSpec semanal by default (#10883)

This PR does not mean mypy supports PEP 612, but it does do enough to
unblock https://github.co...

67a6ad7245d0486034a1e001292229b98314caa9 authored over 3 years ago by Shantanu <[email protected]>
Skip overlapping overload checks in ignored files (#10922)

Resolves #9691

As mentioned in that issue, this is a huge performance win. On the
codebase I...

805bbde281eb0d6bf4ce2b36d7d3a5de93f227e6 authored over 3 years ago by Shantanu <[email protected]>
Optimize construction via list() & dict() (#10918)

Instead of loading the type and calling it via the vectorcall
convention let's use PyList_New /...

989d600f4f708e34d784133b4346d00ca6c96c29 authored over 3 years ago by Richard Si <[email protected]>
Adds docs for TypeGuard type (#10758)

Resolves #10591

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

0bafbfbe316a9973062522984152a72699131273 authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Refactor: reuse format string parser (#10894)

`parse_conversion_specifiers` and `parse_format_value` from mypy.checkstrformat
can be reused ...

9f409c3d89c7fa65eff8cf67883473487e6effd4 authored over 3 years ago by 97littleleaf11 <[email protected]>
stubtest: check type aliases (#10908)

Fixes #10393

Co-authored-by: hauntsaninja <>

7d9f20af865be334cbf7670bfb361530c19ecbb0 authored over 3 years ago by Shantanu <[email protected]>
Document per-module follow_imports more explicitly (#10845)

Helps with #10842, #10820 and others

There have been a number of issues recently where having...

7b0df28a4cdc65601acaaeee72a9266137ffbe57 authored over 3 years ago by Shantanu <[email protected]>
Add OR regex example to --exclude docs (#10903)

Adds an example on how to use the OR-operator to combine two
regular expressions in order to ig...

2c876d5ce36666f9c74ffe0fe8abebdb16831bd6 authored over 3 years ago by Niklas Gustafsson <[email protected]>
[mypyc] Add bytearray support (#10891)

bytearray is treated as a subtype of bytes by mypy, even though they behave
differently in som...

2c909125e6fdc7f8855ead6b0091fc2a878d4462 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Use mypy.FORMAT_RE and ConversionSpecifier for % interpolation (#10877)

mypy.checkstrformat offers regex and ConversionSpecifier for tokenizer, thus
this PR:

* del...

84504b093769de6d3713438a12264a4362bd43c6 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Use native calls in singledispatch dispatch functions (#10888)

When generating calls to registered implementations in the dispatch
function for a singledispat...

a54a177b7ab166d00b96698900125706f384111c authored over 3 years ago by pranavrajpal <[email protected]>
Improve type inference special case that involves union with Any (#10887)

When trying to match `list[T]` and `list[str] | Any`, previously we
gave up, because the union ...

7808e8265cd4cb29dc7f05ff58ab945ab3f2d20b authored over 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Add bytes primitive type (#10881)

Replaces #9611.

10dc4510d9d4fd88ed8dbdc1735f130f334aede2 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Allow registering implementations for singledispatch functions in different files (#10880)

* Add test for singledispatch across multiple files

Add a test to make sure that we handle re...

9b101751cc3214b07799f9ef83258d38aefa4960 authored over 3 years ago by pranavrajpal <[email protected]>
stubtest: be safer with inspect.signature (#10884)

14e06c25f7a7a0fa19aa94c86f30e06f9d115e9e authored over 3 years ago by Shantanu <[email protected]>
stubtest: import submodules mentioned in __all__ (#9943)

* stubtest: import submodules mentioned in __all__

This kind of helps resolves #9935

Co-a...

6fd2dc2403889f7104648d8bfbb8df3f5e83b63f authored over 3 years ago by Shantanu <[email protected]>
Use customized error message for %c interpolation (#10875)

This PR is a follow-up to #10869.

The error msg of mypy now is basically the same as CPython....

bc1dc95486edf4f062a38eb7b78affb2268de39d authored over 3 years ago by 97littleleaf11 <[email protected]>
Fix %c string and bytes interpolation (#10869)

According to [PEP461](https://www.python.org/dev/peps/pep-0461/), conversion type %c performs di...

b3b32427c9abac5a6e3311587745941365ae37cb authored over 3 years ago by 97littleleaf11 <[email protected]>
Fix ParamSpec semanal issue (#10866)

Recreating equivalent ParamSpecExpr objects causes the equality check in
is_same_symbol in add_...

524c9245caed870b484ea2b4c065622f3b6c769b authored over 3 years ago by Shantanu <[email protected]>
[mypyc] Fix order of dispatch type checking in singledispatch functions (#10844)

* Add test

Add a test that makes sure that our implementation goes up the MRO of
the dispatc...

97b3b90356893e2a9f6947ebe52b41cd54ab1cb7 authored over 3 years ago by pranavrajpal <[email protected]>
Adds docs about exhaustive literal and enum checks (#10860)

This feature is not-really known from my experience. I had to explain it several times to other ...

fb75cdc352c8a6da723800619fe05b4ecb4f6cf4 authored over 3 years ago by Nikita Sobolev <[email protected]>
Improves `urls` on https://pypi.org/project/mypy (#10859)

5d84eead94c305552dfb9a76441a1a0d5fb95bb1 authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Build lists using a primitive op (#10807)

Closes https://github.com/mypyc/mypyc/issues/264

This PR adds a primitive op and a C helper f...

6bb22661096e97244e6319169194b97e7eea50ff authored over 3 years ago by 97littleleaf11 <[email protected]>
Fix mypy for new virtualenv (#10855)

This works around a change in virtualenv 20.x where the site-packages folder is added to the PYT...

a1863c901609991348a6e92448c143411e610065 authored over 3 years ago by Ethan Smith <[email protected]>
Pin virtualenv to 16.7.10 (#10853)

virtualenv 16.7.11 appears to have broken our CI by upgrading the
version of pip embedded to so...

1786d90865fb2e6163084743d4116745488a365b authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Tokenizer for printf-style format string (#10808)

We add a special path for %-style string formatting, which previously is compiled by calling a %...

2a332e79e9b6ab4999b3583f18155ccc9e0c0a7a authored over 3 years ago by 97littleleaf11 <[email protected]>
Remove redundant `import`'s and `type_obj` (#10839)

4c6c45508bfa06b3ec442ca4f30d59a956272152 authored over 3 years ago by Elisha Hollander <[email protected]>
[mypyc] Add support for underscore functions (#10830)

This PR adds support for compiling functions named _ even when there are multiple functions name...

7edceadf6ef7de2baab498a5d11b794f891854f5 authored over 3 years ago by pranavrajpal <[email protected]>
Use docstring in specialize.py (#10836)

* Use docstrings in `specialize.py`
* Limit line length of comments and docstrings to 72 charac...

44ecee77fe1838d684847944445b0742922b22b4 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Fix fastcall positional fast path when parser is uninitialized (#10834)

In `CPyArg_ParseStackAndKeywordsSimple`, we don't check if the parser is
initialized, so on the...

f5fab0d164cbcc7652cf9627d3a40fdb47941e62 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Avoid crash in singledispatch plugin for incorrect singledispatch arguments (#10831)

Avoid trying to get the fallback type from the type variables if there
aren't 2 elements in the...

030302dfb2733a8d317542db392c1dde064f3bde authored over 3 years ago by pranavrajpal <[email protected]>
Switch from `toml` to `tomli` for TOML v1 support (#10824)

aede3aefd75332f3911a43bb4a6a98baacce785a authored over 3 years ago by Taneli Hukkinen <[email protected]>
stubgen: Handle commas in namedtuple field definition (#10828)

3bef7b82345bf9c7843e9fd78fd6e7b8408fdb34 authored over 3 years ago by Vanessa Ung <[email protected]>
Fix handling of default arguments in generated glue methods (#10825)

Currently these mostly segfault.

The main tricky case here is with *args and **kwargs (which ...

5e83bd646c1956adade5fa7b13f9e81b56a88802 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Properly track positional-only arguments for unannotated functions (#10802)

I was originally planning to address this by adding an ARG_POS_ONLY
kind (as a concrete win for...

d180456b584b469983e3cc9dddd1e36b997a7427 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Allow redefinition of underscore functions (#10811)

This PR causes mypy to not show an error if a function named _ is redefined,
as a single under...

ed09f8d831aba43af7b7078ceb1d0706e1c124f6 authored over 3 years ago by pranavrajpal <[email protected]>
Make refcounting handle error values loaded into registers (#10819)

Currently the finally path has a hacky pointless branch
on a register that is potentially NULL ...

d0bd1c8ab2585fd1194f753c1a4b5d2a1392e015 authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Improve support for compiling singledispatch (#10795)

This makes several improvements to the support for compiling singledispatch that was introduced ...

7d69ce2ccf6bf751d050c3b65354019878d90739 authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Refactor: rename c_unary_op to unary_op (#10803)

We've been getting rid of the `c_` prefixes.

66cae4b99e585735e3767623991d5f64b8269377 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
stubgen: Add support for yield statements (#10745)

d569ccc0a751fee993023e9b6a2880d1f67b7e93 authored over 3 years ago by Sebastian Rittau <[email protected]>
Fix typos in running_mypy.rst (#10794)

beba94c509211947201ece020e8fe513695ecea0 authored over 3 years ago by Kevin Wojniak <[email protected]>
Better message if method incompatible with base class (#10572)

Closes #3379.

612d59a3c2dadda2cff391637b66a0393b479095 authored over 3 years ago by Anmol Takiar <[email protected]>
[mypyc] Reject instance attribute access through class object (#10798)

Accessing an instance attribute through a native class object results in
unexpected behavior at...

a37c388655619cf44dbf2d60eead5062269eb746 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Fixes typos in mypyc (#10800)

24f3ba0ac4ed34f15739c72c96da152890e31182 authored over 3 years ago by Nikita Sobolev <[email protected]>
Use helper methods for a lot of ArgKind checks (#10793)

Part of the motivation here is that I want to make positional-only
arguments be properly reflec...

a9f3b5e5b21304c63f93e96e0bfeab2fa2945a00 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Make ARG_* into an actual enum class instead of just using int everywhere (#10789)

This is cleaner and more precise and will allow us to add convenience
methods to the class.
(I...

35529715ec2e422fd541538612082daaae853322 authored over 3 years ago by Michael J. Sullivan <[email protected]>
Fixes several typos in semanal.py (#10792)

ebc4f10e9a913bcee076052ce1e2b3d1eb028670 authored over 3 years ago by Nikita Sobolev <[email protected]>
[mypyc] Initial optimization for f-string through a str.join() specializer (#10776)

This pull request adds a specializer for faster constructing f-string, which
is translated int...

30efa34961e44675ccc405cb36b31745ef309660 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Faster int conversion in str.format (#10774)

Closes mypyc/mypyc#875

eb1c52514873b27db93ccb8abecb4b4713feb667 authored over 3 years ago by 97littleleaf11 <[email protected]>
Document use of `...` in overloads (#10772)

cdb268506e55e183048cc2b162413a7f1b8d447f authored over 3 years ago by Anton Agestam <[email protected]>
Support new union type syntax with isinstance (#10775)

Support things like `isinstance(x, int | str)` in Python 3.10

Closes #9880.

f137f11acc168bb529555030427d91c71ad7ac00 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
typeops: extend make_simplified_union fast path to enums (#9394)

In PR #9192 a fast path was created to address the slowness reported
in issue #9169 wherein lar...

fa28616f8bddf00d691eedeeb50459904bd42069 authored over 3 years ago by Hugues <[email protected]>
Avoid mutating the AST when processing register calls (#10779)

Instead of modifying dec.decorators directly, copy it and only modify
the copied version. That ...

e6b59490cfe5e43186064527ea5f4a1cb34b753c authored over 3 years ago by pranavrajpal <[email protected]>
Support new union syntax in stubs always in runtime context (#10771)

Previously it only worked when the target Python version was 3.10. Now type
aliases like these ...

53836bd0407293031f93ad065bc373af2fe1bde2 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Support union type syntax in runtime contexts (#10770)

Support the X | Y syntax (PEP 604) in type aliases, casts, type applications
and base classes.
...

56618b969d478c358e84c3cf2fee27b5076d0d51 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Rewrite CPyStr_Build using a simplification of _PyUnicode_JoinArray (#10762)

This makes specialized `format()` calls faster.

Closes mypyc/mypyc#876.

178df792de7e2d1e06b111bba8e886324cdb23e3 authored over 3 years ago by 97littleleaf11 <[email protected]>
Fixes to generic builtin types (#10766)

This fixes these issues:

* Allow variable-length tuple (tuple[int, ...]) in type aliases
* A...

6eafc5e3487866001d0447514e67d3861c13bb7b authored over 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Add initial support for compiling singledispatch functions (#10753)

This PR adds initial support for compiling functions marked with singledispatch by generating IR...

a5a9e1554b0f637ccb2fd9c0d3b0eb17836fc54a authored over 3 years ago by pranavrajpal <[email protected]>
Preserve types of functions registered with singledispatch (#10756)

When calling a function that has been registered as an implementation
for a singledispatch func...

e07ad3b3bad14ddde2e06982eab87db104a90add authored over 3 years ago by pranavrajpal <[email protected]>
[mypyc] Add a str.format specializer which only supports empty brackets (#10697)

This PR adds a str.format specializer which only supports empty brackets. Also, the
detection ...

e82e8ecaa5b441310fbd0e2351d2d576dff62215 authored over 3 years ago by 97littleleaf11 <[email protected]>
[mypyc] Add a special case for len() of a str value (#10710)

Closes mypyc/mypyc#835

* Add a branch for str_rpimitive in builtin_len
* Reduce redundant co...

49bb90a5c32b596f3aefca1f6ae9f18c9e1ddb32 authored over 3 years ago by 97littleleaf11 <[email protected]>
Make --cache-fine-grained imply --local-partial-types (#10737)

dmypy requires local-partial-types, so without specifying it, we generate
a cache that is usele...

198592832b2223122090e00f6bcac9e1e24d6018 authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Fix class-based named tuples (#10746)

These only worked with the simplified stubs used in tests.

e896ca4a16b0b220c1aa246c787c0d12124d29f8 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Add initial singledispatch typechecking support (#10694)

Adds initial support for type checking uses of the singledispatch decorator,
including support...

c3ca0d69659b941fc6b425dd3563cae11454baac authored over 3 years ago by pranavrajpal <[email protected]>
Narrow type with typevar when the upper bound is a subtype (#10658)

Fixes #10605

cae5d3c8b5f14d0796914aa6a113473ca3ffc38e authored over 3 years ago by ethframe <[email protected]>
Try ignoring Anys in type object callables for purposes of overload ambiguity (#10734)

I believe this should help with some issues that come up with #10694.

416f57bed76d6a2aca15934c24a850464e6c99ca authored over 3 years ago by Michael J. Sullivan <[email protected]>
[mypyc] Add tests for str format() and fstring (#10729)

a8c32c99ba6e8ab80a746e6615b40bcd38c14789 authored over 3 years ago by 97littleleaf11 <[email protected]>
Use variable annotations (#10723)

* Run com2ann

* manual fixes (mainly None defaults)

* manual fixes (mainly stringifying ty...

f98f78216ba9d6ab68c8e69c19e9f3c7926c5efe authored over 3 years ago by Shantanu <[email protected]>
Make verify first type a supertype of all dispatch types (#10727)

Change the type of the first argument of verify (the type that
singledispatch is dispatching on...

9851cce030773491d184b4f365d0918a892b2c89 authored over 3 years ago by pranavrajpal <[email protected]>
Update getting_started.rst (#10720)

Installation instruction example for requests (https://mypy.readthedocs.io/en/stable/getting_sta...

3dcccf221ead4b3143208fc2a1631336d6186e45 authored over 3 years ago by geo7 <[email protected]>
Allow plugin signature hooks to return FunctionLike (#10717)

Change the type of the get_method_signature_hook and
get_function_signature_hook plugin hooks t...

87a3503e7c90ff2d5734ba2718376e5f515602e8 authored over 3 years ago by pranavrajpal <[email protected]>
stubtest: add assert is not None for singledispatch plugin (#10716)

SymbolTableNode.node can be None, which means that we may accidentally
passing None to verify, ...

8054d9c0a146e794b97cad9ada84b79e2406c177 authored over 3 years ago by pranavrajpal <[email protected]>
Drop Python 3.5 support (#10706)

379622de482ec16dd1676ad6d183dcfca5203194 authored over 3 years ago by Shantanu <[email protected]>
Bump version to 0.920+dev (#10702)

48181d26e7575aece8cab61eb866ac6c573dfd76 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Delete outdated TODOs (#10698)

Delete two outdated TODOs.

20babc52a11fd98f5073c13875573269c53ee4d5 authored over 3 years ago by 97littleleaf11 <[email protected]>
docs: updating URL in comment (#10693)

1fcb71e53f2e08a999e6f393543c64327c596d01 authored over 3 years ago by Henry Schreiner <[email protected]>
Replace variable annotation with type comment to fix Python 3.5 (#10690)

The wheel builds were broken. Our CI no longer uses Python 3.5.

3a856cc6738bde4fa988a59c521c63009c338925 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Fix crash when inferring multiple assignment with overloaded function (#10689)

When using lvalue context to re-infer call to an overloaded function,
the inferred tuple type c...

3319826beb8cd1b3e787b60ed5f240c86c5b3c7d authored over 3 years ago by Jukka Lehtosalo <[email protected]>
[mypyc] Support various number-related dunders (#10679)

This adds support for these unary dunders:
* `__neg__`
* `__invert__`
* `__int__`
* `__float...

f91fb1a6ee0908faf856684dc2e60afc8b9a9daf authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Don't ask to install a stub package if stubs are installed (#10670)

If we encounter an import of a submodule of a package with installed
stubs, and the submodule d...

002722e26fc626f935f597f45fabaa560d85a4ad authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Call get_method_hook when methods are used in decorators (#10675)

When a method is used in a decorator, pass the full name to plugins
through the get_method_hook...

e4c2668e29bfe6f588143af00a7021e5d3b7e747 authored over 3 years ago by pranavrajpal <[email protected]>
refactor: add contextmanager to VariableRenameVisitor (#10685)

08e6ba888ea8deb81a6ccea0a04ff7a2b3149d56 authored over 3 years ago by Anmol Takiar <[email protected]>
[mypyc] Only construct dict setdefault collection when needed (#10668)

Closes mypyc/mypyc#830

Add dict_setdefault_spec_init_op.

1573336d12ec56454b6a3ed6633acff8bb2c4737 authored over 3 years ago by 97littleleaf11 <[email protected]>
Fix crash with assignment to variable guarded with TypeGuard (#10683)

This is a quick fix to unblock the 0.910 release.

The type guard type can be unrelated to the...

749dbf092220d992fda5f879210c907e99927a03 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Document --install-types --non-interactive (#10684)

81ad8c309c9cadbd50d784bb251b1aa60f30213f authored over 3 years ago by Jukka Lehtosalo <[email protected]>
pkg_resources is now in types-setuptools (#10681)

Depends on python/typeshed#5669

ac2caced3e2792405c70dcf1a235c3e891f21771 authored over 3 years ago by Sebastian Rittau <[email protected]>
Check __bool__s in MRO for Literal return type (#10678)

2ebdbca3b5afbfa1113f01b583522f4afcc4b3e3 authored over 3 years ago by Ilya Konstantinov <[email protected]>
fix testSemanticAnalysisFalseButTypeNarrowingTrue (#10676)

It was indeed weird that Union[builtins.bool, Literal[True]] wasn't simplified by make_simplifie...

aad58f0aa2610ed5e6306dc17e57fc9086605c52 authored over 3 years ago by Ilya Konstantinov <[email protected]>
Fix testNonBooleanContainsReturnValue (#10677)

43862895ec490255a6ec11166dc1c07426f8fd90 authored over 3 years ago by Ilya Konstantinov <[email protected]>
update --warn-unreachable to respect if the code should be type checked (#10291)

Mypy currently will warn about unreachable code regardless if the code
"should" be type checked...

1e7c471ba536a027a2b7dc44a6d63e485279a5c1 authored over 3 years ago by Terence Honles <[email protected]>
Document typing information inside sdist (#9684)

Co-authored-by: Marius Gedminas <[email protected]>
Co-authored-by: Guido van Rossum <gvanrossum...

7e7ea2bba741253d22ab1f67c7f854d3b5ff8847 authored over 3 years ago by Sorin Sbarnea <[email protected]>
Run build a second time when using --install-types --non-interactive (#10669)

If the first build finds missing stub packages, run the build a second
time after installing ty...

40dfd7b79ba16b6ae70ab69b27728ca2bbd64104 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Improve error reporting when --install-types has no cache (#10667)

There are no tests since our test framework makes it tricky to
write tests for these kinds of s...

bf231bea84d78ba7554a3784eba8009d89378166 authored over 3 years ago by Jukka Lehtosalo <[email protected]>
Fix faulty casts in checker (#10560)

Fixes #9615, fixes #9682

Both issue reports hit the faulty cast on L2803. This changes the lo...

b0e36aab1dfc1a4f9df290b4d133d334ff254ecd authored over 3 years ago by Shantanu <[email protected]>
Update docs for deferral of PEP 563 to 3.11 (#10655)

Resolves #10648

7f54bd064399ee4e38586c311a2796ff3f255276 authored over 3 years ago by Smart <[email protected]>
Add tests for singledispatch (#10627)

Add mypy tests for singledispatch that represent common errors that we
probably want to handle ...

d3c30feaf0d04d3e7c7af1218f8cec3a97699398 authored over 3 years ago by pranavrajpal <[email protected]>
pyopenssl types package name was corrected (#10656)

It's now also available for Python 3

d87d468ee80908a865c388a7743c84c1f5c917d7 authored over 3 years ago by Sebastian Rittau <[email protected]>
Don't suggest to install stubs with py.typed files (#10652)

The pallets libraries are now bundled with a `py.typed` file. Suggesting to install these stubs ...

4dd954f2ae3086eea59e2dfbf115af99a76451dc authored over 3 years ago by Sebastian Rittau <[email protected]>
[mypyc] Raise ImportError instead of AttributeError when from-import fails (#10641)

Fixes mypyc/mypyc#707.

a9fda34dc68896df0405d8d9d8084148b7917bf5 authored over 3 years ago by 97littleleaf11 <[email protected]>
check_boolean_op: clean up semanal/type-based reachability (#10566)

790ab35ca936d04c484d427704d5acb17904012b authored over 3 years ago by Ilya Konstantinov <[email protected]>