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

Optimization: Enable always defined attributes in Type subclasses (#14356)

Use lazy initialization to avoid method calls in `__init__`. This allows
mypyc to infer more al...

ec4404ae331170f6d033f442906a547dec319e02 authored about 2 years ago
Optimization: Remove expensive context manager in type analyzer (#14357)

This makes mypy a bit faster and the implementation seems a little
cleaner as well.

(Various...

45bed9c994b1082a050e26958c1847b53ad82357 authored about 2 years ago
[undefined vars] do not double report errors in class defs (#14350)

These errors are already reported by the (new) semantic analyzer.

I've discovered this while...

20e9733e32ddff6ecbaddb7be61ae36b6c4978d0 authored about 2 years ago
[undefined vars] fix per-module error code override bug (#14351)

This one would occur because we set the errors module with global
options, instead of per-modul...

109c8ce84685136d1cd89c86d4b3458272a6144f authored about 2 years ago
subtypes: fast path for Union/Union subtype check (#14277)

Enums are exploded into Union of Literal when narrowed.

Conditional branches on enum values c...

1f8621c483baf4641c317ad755f814bcb9e41296 authored about 2 years ago
Micro-optimization: avoid Bogus[int] types that cause needless boxing (#14354)

I want to get rid of all the bogus types eventually.

61a21baf7e37069b829f19bd74416c01f1b84404 authored about 2 years ago
mypy_primer_comment: Resolve node.js 12 actions deprecation warning (#14352)

Resolves the following warning:

![image](https://user-images.githubusercontent.com/1350584/20...

632304f90923ba38483d94de3cf58d486966f4f0 authored about 2 years ago
Avoid slow error message logic if errors not shown to user (#14336)

This helps with await-related errors introduced in #12958, in
particular, which are expensive t...

5349f9a6e3ea53a7def2e895cfb3bc3938880052 authored about 2 years ago
Speed up the implementation of hasattr() checks (#14333)

This makes the implementation of hasattr() checks faster (introduced in
#13544).

In particul...

01a1bf6bf4615e548b195b657756f9c57f8631a4 authored about 2 years ago
Improve searchability for module level type ignore errors (#14342)

c246a527008c28cf4970b28b85f7ccb5ce6ba285 authored about 2 years ago
stubtest: Improve heuristics for determining whether global-namespace names are imported (#14270)

Stubtest currently has both false-positives and false-negatives when it
comes to verifying cons...

31b041344eab4b84971924cdcb45ba06dffe6d6c authored about 2 years ago
Fix docs build (#14334)

The docs build is currently failing on `master`: see e.g.
https://github.com/python/mypy/action...

25146105416863c4237380354b7f15102448b324 authored about 2 years ago
Tool to compare performance of any number of mypy commits/branches (#14332)

The script compiles some mypy commits in parallel and then measures how
long each version takes...

1a7823ecaad94d8da11b626de90c37972c00c43e authored about 2 years ago
Avoid the use of a context manager in hot code path (#14331)

Mypyc can't optimize context managers yet, so it's best to avoid them in
hot code paths.

Thi...

87335997808207a138125a2f52fb8f4dc5a69fa3 authored about 2 years ago
Refactor TypeState into a singleton class (#14327)

This helps mypyc, since accessing mutable attributes of singleton
instances is faster than acce...

4e32da85bdae5b379711c6a1443a58e37d003037 authored about 2 years ago
Change various type queries into faster bool type queries (#14330)

I measured a 1% performance improvement in self check.

2d5108b343ad11f5e2087e9e8ed55202cbd3237c authored about 2 years ago
Fix RST markup in type_narrowing.rst (#14253)

Switch :py:func:type to py:class:type in type_narrowing.rst. The former does not render properly...

cb1d1a0baba37f35268cb605b7345726f257f960 authored about 2 years ago
Revert "[mypyc] Use tabs instead of spaces in emitted C code (#14016)" (#14152)

This reverts commit dbcbb3f5c3ef791c98088da0bd1dfa6cbf51f301.

The indentation in generated co...

f7ed65b0ff3b1bb82ff5e305129bfc251dfeec1d authored about 2 years ago
Allow 'in' to narrow TypedDict unions (#13838)

`in` could narrow unions of TypeDicts, e.g.
```python
class A(TypedDict)
foo: int

@fina...

41574e0cc521987376dc8c149095b3483aff80ff authored about 2 years ago
Speed up recursive type check (#14326)

Use a faster type query visitor and reuse visitor across calls.

This should speed up type che...

7ed4f5ef3cff221505a54851a23fd80fa0a412c6 authored about 2 years ago
Optimize subtype checking by avoiding a nested function (#14325)

Mypyc isn't good at compiling nested functions, and this one was in one
of the hottest code pat...

b5fc748a1ccb65a9d4dc0eef897c71ee8b15ddc9 authored about 2 years ago
Optimize type parameter checks in subtype checking (#14324)

Avoid the use of a nested function, which are a bit slow when compiled
with mypyc. Also avoid a...

d35e571ef303ec63f4c8c3437669c858d85329eb authored about 2 years ago
Speed up freshening type variables (#14323)

Only perform type variable freshening if it's needed, i.e. there is a
nested generic callable, ...

c588852451ec63f9a26fefe5eb82976aa03d611c authored about 2 years ago
Optimize implementation of TypedDict types for **kwds (#14316)

The implementation copied lots of callable types even when not using
the new feature, which was...

c4144640a98fb7ddc1eaacc26f659042d1a27e75 authored about 2 years ago
Update `stubinfo.py` for recent typeshed changes (#14265)

Removals from `stubinfo.py`:
- `atomicwrites` is archived and deprecated at runtime; stubs were...

fcd705d3149906d1fa892c4ae9e5458275007b24 authored about 2 years ago
Enable `--debug-serialize` for mypy_primer (#14318)

Enable the `--debug-serialize` option to help catch issues during
serialization which would nor...

2e3144c6a27cbe15d22c5240100b96b98cba6dbd authored about 2 years ago
Add `--debug-serialize` option (#14155)

Currently, `mypy_primer` sets `--cache-dir=/dev/null` which disables
cache generation. This can...

d5dc1fb4cc6ff969f125f5fb8bc51c2a29659bc1 authored about 2 years ago
Add basic support for `typing_extensions.TypeVar` (#14313)

This PR only adds the existing `TypeVar` support for the
`typing_extensions` variant.
I.e. it ...

97d9ed59a0e33c86efd37fa90a4cbdb53c9b62a0 authored about 2 years ago
[undefined vars] skip visiting unreachable else clauses (#14308)

In particular, ran into an issue with an `if TYPE_CHECKING` case, so I
added a test for that.

d391f108c195533a5800afe73f5b3257babc83a3 authored about 2 years ago
[used-before-def] fix false positive inside loop (#14307)

A similar case was addressed in #14176 but I missed the part where it
doesn't need to be define...

b1388e0b479868623f9bcb18491f8b041c68e512 authored about 2 years ago
[partially defined] implement support for try statements (#14114)

This adds support for try/except/finally/else check.

The implementation ended up pretty compl...

96ac8b3e71c743b02ea4e3c84da0248659e40f82 authored about 2 years ago
Constant fold initializers of final variables (#14283)

Now mypy can figure out the values of final variables even if the
initializer has some operatio...

df6e828198205e91e88b2f202e72441c531d5227 authored about 2 years ago
Sync typeshed (#14295)

Source commit:

https://github.com/python/typeshed/commit/9bddd3a3f1abfaf6335c2139a77ff1ff69eb...

369525071a548c03ddea1c428207c8801e73192f authored about 2 years ago
Run against 3.12-dev in CI (#14050)

d62be28cc85efd759d808b983e1cf55242c2d71a authored about 2 years ago
Added error for class attribute access with slot (#14125)

Fixed #13103

Adds a check to class attribute access to ensure it isn't a defined
slot.

7eef68af8b91e4509ddf73eb37c22a1a2197039d authored about 2 years ago
Replace unsafe PY_*_VERSION comparisons to fix for Python 4.0 (#14280)

`#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 7`

For example, this is true for Python 3.7...

42dc1c431ed252de41f96d65367623ebac9e1bb8 authored about 2 years ago
stubtest: catch BaseException on module imports (#14284)

This came up in https://github.com/python/typeshed/pull/9347

b0003aff931c12298fb462aa4cece18610ee4d05 authored about 2 years ago
Rename `partially-defined` error codes (#14267)

Rename `partially-defined` to `possibly-undefined` and `use-before-def`
to `used-before-def`.
...

7849b8f15dccf69173b4ff172524c4d82a70bc2d authored about 2 years ago
(🎁) canwecolorπŸš€ (#14051)

Last time i checked it wasn't the 1960's. So I think the CI could be
colorized.

Configured p...

695ea3017fee084c9d2ec17d9b28f8af905e3b63 authored about 2 years ago
Replace TypeList in constraints with TupleType (#14257)

Now that the fallback is available, we can construct TupleTypes instead
of TypeLists which will...

7da2abf9a5a05fffc3d07caef31681c50bc9d6e7 authored about 2 years ago
[mypyc] Support tuples of native ints (#14252)

A tuple such as `tuple[i64, i64]` can't have a dedicated error value, so
use overlapping error ...

dde01d6bfbed3bd0a477d54b15f49e5187b38038 authored about 2 years ago
Enable Final instance attributes for attrs (#14232)

A quick patch to enable the following scenario:

```python
@define
class C:
a: Final[in...

7e9aa7433c72e0950229a34e0c086d7829208f06 authored about 2 years ago
Allow trailing commas in `ini` configuration of multiline values (#14240)

Now these two samples are identical:

```ini
[mypy]
enable_error_code =
truthy-bool,
r...

d2ab2e7dd1a4a43b0cb6626a63d722387f53b7bc authored about 2 years ago
Advertise mypy daemon in README (#14248)

Now that daemon is more mature and stable I think we can attract some
more attention to it.

924bc68b07bec2b72ce055f6cd95f6aea11fda7e authored about 2 years ago
Add link to error codes in README (#14249)

Several issues that I have seen recently could be fixed by
enabling/disabling an error code. I ...

0885d85a7b224cefb56fe63a75bb29ab73a23183 authored about 2 years ago
Stop saying mypy is beta software (#14251)

Ref #13685

cc @Michael0x2a @JukkaL @hauntsaninja

Co-authored-by: Alex Waygood <Alex.Waygo...

7785b6035e919180593f027305171e4a844a947b authored about 2 years ago
Flycheck-mypy is deprecated. Its functionality was merged in Flycheck (#14247)

See https://github.com/lbolla/emacs-flycheck-mypy#readme

734a0b96b79f20b3290ca5fee97c749ccb2e308f authored about 2 years ago
Fix incorrect class names in literal_types.rst (#14237)

b8c03ab6809aab56928f3cd865edb44944a600a2 authored about 2 years ago
[mypyc] Add `match` statement support (#13953)

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

Like the title says, this PR adds support fo...

d5e96e381f72ad3fafaae8707b688b3da320587d authored about 2 years ago
Fix --fast-exit argument (#14229)

Previously --fast-exit would actually disable the fast_exit option. Now
it behaves as expected ...

740b36428d8817d276e46f817ac11b18cea4d766 authored about 2 years ago
[stubtest] associate exported symbol error with __all__ object_path (#14217)

ceb976f1b9bc4c3ae7cd07a5222ec076f6c7ab72 authored about 2 years ago
Give TypeVarTupleType a fallback (#14231)

We want to eventually decomission the use of TypeList for
constraints/expanded values of TypeVa...

8da17d71e156140e67057703a46805637ab869cf authored about 2 years ago
Fix false negatives involving Unions and generators or coroutines (#14224)

Fixes #14223

3c71548c0bc7955c462211985859c273bd9224bc authored about 2 years ago
Sync typeshed (#14228)

Sync typeshed

Source commit:

https://github.com/python/typeshed/commit/87d2683ef974ef6d6d8...

6e9227a8cedf268799d2f0442ec855db46414778 authored about 2 years ago
[partially defined] fix a false-negative with variable defined in a skipped branch (#14221)

The goal of partially-defined check is to detect variables that could be
undefined but semantic...

d3427c1ad5064afb6bddee459a24a91fdc036b76 authored about 2 years ago
[partially defined] fix false positive with global/nonlocal vars (#14222)

This is a workaround until we implement better handling for variables
undefined in global scope...

98f1b00a3b41b3734f7a20adbd755c13e37beb43 authored about 2 years ago
[stubtest] Add `__warningregistry__` to the list of ignored module dunders (#14218)

We have multiple of these in `typeshed`:
https://github.com/python/typeshed/search?q=__warningr...

3a3cf412b278ee7bf710742b168beed41c1c02f2 authored about 2 years ago
[use before def] handle class and function definitions (#14203)

Previously, we would ignore any class definitions and would fail to
detect undefined classes an...

d094c381277b7bec3c3b9956a53395e989347112 authored about 2 years ago
[docs] Update `running_mypy.rst` - fix typo (#14212)

Fix typo - remove an unneeded period

https://mypy.readthedocs.io/en/stable/running_mypy.htm...

8ab0ef1bbcbae730ce94d59b19f024e968cab1dc authored about 2 years ago
Fix ParamSpec constraint for types as callable (#14153)

Most types can be considered as callables, constructing the type itself.
When a constraint was ...

19c7fd3815ca68074da317f8f63627194831dcfe authored about 2 years ago
Fix crash in Self type on forward reference in upper bound (#14206)

Fixes #14199

This is straightforward, just use the same logic as for regular (user
defined)...

365297c5240af67acb4798a18135dc87b734477b authored about 2 years ago
Fix a crash when incorrect super() is used outside a method (#14208)

Ref #14201

00ee7d5137854f9ae09060f834a6e988ee04e342 authored about 2 years ago
[partially defined] respect check-untyped-defs flag (#14204)

We should not check untyped functions unless --check-untyped-defs is
set.

This is part of th...

71288c749f1507feab0b2ffcc312f1fb7c33cc46 authored about 2 years ago
[partially defined] use correct error code in nested if statements (#14193)

In order to know to use `partially-defined` code vs `use-before-def`, we
had to check if a vari...

5c3d306fddd900a2eb66437af05dd36851b221a4 authored about 2 years ago
[partially defined] rework handling of else in loops (#14191)

`else` in loops is executed if the loop didn't exit via a raise, return,
or a break. Therefore,...

a82c288890e80ec85cc8d84985a65d6c4b7f9ffe authored about 2 years ago
[partially defined] fix gating by error code (#14194)

This was incorrect for a few callsites. I refactored the code to make it
harder to make a mista...

5795488903f807211d267d3319d153c30e74b77e authored about 2 years ago
stubtest: if a default is present in the stub, check that it is correct (#14085)

Helps with python/typeshed#8988.

a9c62c5f82f34a923b8117a5394983aefce37b63 authored about 2 years ago
Implement miscellaneous fixes for partially-defined check (#14175)

These are the issues that I've found using mypy-primer.

You should be able to review this PR ...

d58a851463fca5f2512c66e3db7ecee0d26d1eae authored about 2 years ago
Switch error code used to report vars defined in different branch (#14176)

We previously used `use-before-def` code here but this commit switched
it to use `partially-def...

db0beb1014d8367221d47d3b11e2b49e757fa2fa authored about 2 years ago
Fix crash on overriding with frozen attrs (#14186)

Fixes #6715

Fix is straightforward, currently we assume that if we have a variable
in MRO, ...

278a09537ac51a131b1298e4d1ba015bac3fc8c5 authored about 2 years ago
Fix type aliases with fixed-length tuples (#14184)

Fix type aliases like these:
```
T = tuple[int, str]
```
Type applications involving fixed-l...

a9024a801b2fe11f1e67ea62d55b22f4dc913076 authored about 2 years ago
Fix issues with type aliases and new style unions (#14181)

Fix aliases like this and other aliases involving new-style unions:
```
A = type[int] | str
`...

7ea5ff6c1476d425b6434405add819f0e1abec67 authored about 2 years ago
Proposal: don't simplify unions in expand_type() (#14178)

Fixes #6730

Currently `expand_type()` is inherently recursive, going through
`expand_type` -...

4471c7e76f27ee51eb8d47a4803097ec15c62128 authored about 2 years ago
Support ParamSpec variables in type aliases (#14159)

Fixes #11855
Fixes #7084
Fixes #10445
Should fix #4987

After thinking about this for some...

13bd201586e837962239dbdca8eda1f9966ebfc2 authored about 2 years ago
Add intenal flag for per-line type checking peformance (#14173)

This should help with the investigation of tricky performance
regressions like https://github.c...

04d44c12cfbb3a469a96253d4656d16c21be41b9 authored about 2 years ago
Simplify callable overlap logic (#14174)

This gives around 1% speed-up on self check, and may give even more for
code that is heavy on o...

07139ef8121fda39906e7a804ef599e61413c0c7 authored about 2 years ago
Don't install lxml on Windows on Python 3.11 (#14170)

Windows wheels for Python 3.11 are not included in the release, and
`cibuildwheels` cannot buil...

acbc40c50e0236a52bdd35583688fc391db1a410 authored about 2 years ago
Detect variables that are used before they're defined (#14163)

This implements a check when a variable is defined before use. Something
like:
```python
def ...

f656efc07c3d1e167d2d6873ffbfe254aa7225ff authored about 2 years ago
[partially defined] handle unreachable blocks (#14161)

This adds support for unreachable blocks in `partially-defined` check.

Currently, this only s...

8fb482ff72f94b1f16e6c63746d4cb9cd111c76c authored about 2 years ago
Try empty context when assigning to union typed variables (#14151)

Fixes #4805
Fixes #13936

It is known that mypy can overuse outer type context sometimes
(es...

b83ac9cff3d38f868e45e4c4b011cbd2fdd37fc3 authored about 2 years ago
Allow function arguments as base classes (#14135)

Fixes #5865

Looks quite easy and safe, unless I am missing something. Most changes
in the d...

3c5f368872413fae867bf4a2dff7781cbf547459 authored about 2 years ago
Avoid use of implicit optional in decorator factory docs (#14156)

c660354846688ff8158d0f0178eb298171b74f5b authored about 2 years ago
Make is_recursive and has_recursive_types() more consistent (#14147)

While working on another PR I noticed that current behavior of
`has_recursive_types()` is incon...

f8d71f13d408198f81d55a6b57bf1d2c1b81a3c2 authored about 2 years ago
Fix incremental crash on generic function appearing in nested position (#14148)

Fixes #14137

Fix is trivial, I just forgot to call `super()` in one of my previous
PRs.

e814c47a1950dba765207333cf91a61a2d9188ee authored about 2 years ago
Make non-numeric non-empty FORCE_COLOR truthy (#14140)

Fixes #14139

56e9396e681d779cbb593d82d21c1fae76c6f430 authored about 2 years ago
Fix type query for recursive aliases (#14136)

See https://github.com/python/mypy/pull/14130 for context.

Btw it looks like these `Any` repo...

6cd8e007923acef7a2899e85378bc4822472b848 authored about 2 years ago
Update code example in "Declaring decorators" (#14131)

- Added missing cast import
- Changed revealed type

Co-authored-by: Shantanu <12621235+haunt...

a2477ff0d0cb751f27a2b38d27ce6572ead03451 authored about 2 years ago
Correctly handle Enum name on Python 3.11 (#14133)

Fixes #12483
Fixes https://github.com/python/typeshed/issues/7564
Ref #12841

The fix is str...

05a3f7d8d61bc298809e5363d3a23aa16fe776d2 authored about 2 years ago
Revert ctypes patch on an ongoing basis (#14129)

1cc4a7d38daac2aa641c9355a27820beba3542e1 authored about 2 years ago
Enable lxml tests on Python 3.11 (#14134)

Ref #12840

a206096050d87db65aa8fcd3ab3f3d0dc2302036 authored about 2 years ago
Fix daemon crash on malformed NamedTuple (#14119)

Fixes #14098

Having invalid statements in a NamedTuple is almost like a syntax error,
we ca...

1d6a5b1d2abf617b149e8bf8ff435f64dc507fd3 authored about 2 years ago
Revert use of recursive alias in typeshed (#14130)

Easy crash to repro: `mypy --any-exprs-report=out -c 'pass' --show-traceback`

b650d9633d508005fc030e5e80097d74c3d24d0d authored about 2 years ago
Revert typeshed ctypes change (#14128)

Since the plugin provides superior type checking:
https://github.com/python/mypy/pull/13987#iss...

0062994228fb62975c6cef4d2c80d00c7aa1c545 authored about 2 years ago
Sync typeshed (#13987)

Source commit:

https://github.com/python/typeshed/commit/263427f438aa7d3f0bd570f671ecba9299c1...

6e70826f94a8e9018ad1f3e975570ef1a14f2fc4 authored about 2 years ago
mypy_primer: truncate per-project output (#14091)

Closes #14059

abb5a809e3ec387f46898817c15a2d3137aee819 authored about 2 years ago
Fix class objects falling back to metaclass for callback protocol (#14121)

Fixes #10482

This is not very principled, but should work except people will want to
explic...

6d1bcc1a97b15097fdfda96ae4fb0fad1e2499d7 authored about 2 years ago
Correctly support self types in callable ClassVar (#14115)

Fixes #14108

This fixes both new and old style of working with self types. After all
I fixe...

401798fe7f36dc2e664bfae773c9faf5033aa6df authored about 2 years ago
Fix crash during ParamSpec inference (#14118)

Fixes #13903

The fix is straightforward, the formal to actual map needs to be
refreshed twi...

823667d55ca9387e4645ef2bef649cca90b9829f authored about 2 years ago
Handle prefix/suffix in typevartuple *args support (#14112)

This requires handling more cases in the various places that we
previously modified to support ...

885e361b1cf97260d80e9dfa4e494ff362f0edff authored about 2 years ago
Fix type variable clash in nested positions and in attributes (#14095)

Addresses the non-crash part of #10244 (and similar situations).

The `freshen_function_type_v...

48c4a47c457b03caf00be2e2dacd91c3635cdc90 authored about 2 years ago