profile
viewpoint

dropbox/pyannotate 1140

Auto-generate PEP-484 annotations

dropbox/sqlalchemy-stubs 312

Mypy plugin and stubs for SQLAlchemy

gvanrossum/pyxl3 119

A Python 3 extension for writing structured and reusable inline HTML.

JukkaL/mypy-website 12

Source code for the mypy web site

msullivan/LazyK 12

Updated LazyK source distribution

msullivan/godels-t 6

Formalization of a bunch of properties of Godel's System T in agda

jwise/minilib 3

A small C library that one might wish to plop down in bare-metal projects.

msullivan/advent-of-code 3

my advent of code solutions

msullivan/cmd-queue 3

A really dumb script for running a queue of commands

msullivan/he-man 2

Haskell Event Manager, Apropos Networking

push eventedgedb/edgedb

Michael J. Sullivan

commit sha f44eb7437311e7dac192eb10c929b43097ffdd34

fix

view details

push time in 3 hours

Pull request review commentedgedb/edgedb

Fix renaming and deleting abstract constraints

 def test_schema_migrations_equivalence_rename_refs_06(self):             alias Alias3 := Remark { command := .remark ++ "!" };         """]) +    def test_schema_migrations_equivalence_rename_abs_constraint_01(self):

Looks like we already have the xfailed test we want test_edgeql_migration_describe_constraint_01, so I just updated its description

msullivan

comment created time in 4 hours

PullRequestReviewEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha f086f10f89e096273122fdb23b99ee6fb1fc4768

Be proactive about catching bogus renames (#1906)

view details

James Clarke

commit sha 7d500aa6aad95dcb2c85c1cf581bc8d3ee774ca5

Refactor imports in edb.tools.docs to allow sphinx to build docs with minimal dependencies Co-authored-by: Yury Selivanov <yury@edgedb.com>

view details

Elvis Pranskevichus

commit sha 6c5411e083189d40b80b1859a35701837e45b18f

Parallelize dump tests The current implementation of dump compatibiliy tests checks them sequentially one by one. Since each check is very slow, this test is, by far, the slowest in the test suite. Fix this by generating a test method for each dump file, which makes it possible to run them in parallel.

view details

Elvis Pranskevichus

commit sha a453f894e9546ba5f3ea37d90bd83be24a4179da

Improve handling of test isolation and parallelism The current application of `ISOLATED_METHODS` and `SERIALIZED` attributes of test suites is somewhat arbitrary and often misplaced right now. First of all, rename `SERIALIZED` to `PARALLELISM_GRANULARITY` and make it an enum: 'default', 'database' and 'system' to signify the scope of test side effects. While at it, rename `ISOLATED_METHODS` to `TRANSACTION_ISOLATION` to clarify which isolation we are talking about. Finally, remove misplaced `TRANSACTION_ISOLATION = False` from several test suites which used it only to avoid having to deal with error recovery in transactions. Use `assertRaisesRegexTx` properly instead.

view details

Elvis Pranskevichus

commit sha edbf2996ef81f4ab82b69649844714f425d2e898

Allow copying databases in testmode

view details

Elvis Pranskevichus

commit sha e1cd2bbf839eaeb661263b5d9cd3ba335a5361ba

Parallelize tests with database PARALLELISM_GRANULARITY The trick here is to make a copy of the test database for each test worker picking up a test from a suite with `'database'` `PARALLELISM_GRANULARITY`.

view details

Elvis Pranskevichus

commit sha ce2f48d6be3a4111069ef4040694003ed7ac3c51

tests: Hide database-copying test parallelization behind a debug flag The database-copying test parallelization is apparently causing test run time regression on some setups, so hide it behind a debug flag until we figure out how prevalent the regression is.

view details

Michael J. Sullivan

commit sha 06cbfb14a2d2a5022cef315302f30d51444fac0a

Test/fix renames for aliases, abstract annots, enum/scalar types (#1907) Work on #1772.

view details

Michael J. Sullivan

commit sha 5d9957cc0f65084b1ad49288dd7fc7acb26836b7

Test/fix abstract constraint renames

view details

Michael J. Sullivan

commit sha 6c73b70220205ed4d3461dbd7b18a86d316cf0ca

rename and delete constraint params

view details

Michael J. Sullivan

commit sha 9eca58cf65aee9e4dcf4b3f975268042251ecc34

schema test

view details

Michael J. Sullivan

commit sha c034d1e4b453be5a0139f7dbba47d9521ce49128

ugh also rename concrete constraint children...

view details

Michael J. Sullivan

commit sha 139b5c481ac42e8f653b611315d6b96594f02842

Found an xfailed test and updated its description

view details

push time in 4 hours

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 06cbfb14a2d2a5022cef315302f30d51444fac0a

Test/fix renames for aliases, abstract annots, enum/scalar types (#1907) Work on #1772.

view details

push time in 5 hours

delete branch edgedb/edgedb

delete branch : renames-all-day

delete time in 5 hours

PR merged edgedb/edgedb

Test/fix renames for aliases, abstract annots, enum/scalar types

Work on #1772.

+225 -18

0 comment

4 changed files

msullivan

pr closed time in 5 hours

issue commentpython/typed_ast

Who has owner permissions on this repo?

Sure.

gvanrossum

comment created time in a day

issue commentpython/typed_ast

Who has owner permissions on this repo?

Not me. Either @JukkaL or @ddfisher?

gvanrossum

comment created time in 2 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 2edb8d2391fce6bae40259275975fe318c66fa7d

ugh also rename concrete constraint children...

view details

push time in 3 days

PR opened edgedb/edgedb

Fix renaming and deleting abstract constraints

The parameter renaming logic is shared with functions (for now only used when renaming due to a type change).

Work on #1772.

+205 -62

0 comment

6 changed files

pr created time in 4 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha b773c83f383916f6a9fd620270fb6589f595b827

rename and delete constraint params

view details

Michael J. Sullivan

commit sha 5e2f6cc6384b980c27515f3aa53e9ca6f811ea34

schema test

view details

push time in 4 days

create barnchedgedb/edgedb

branch : renames-electric-boogaloo

created branch time in 4 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha f29828a9b78c8ebfd971de032b6191fd1c9c0755

some more alias tests

view details

Michael J. Sullivan

commit sha e271aa62b413e396c8537318c1f8160b51beb8c3

add an annotation test

view details

Michael J. Sullivan

commit sha 29adde196d1258160b1442cb859f850a4a4ca04a

an xfailed test

view details

Michael J. Sullivan

commit sha d3f4d8505cd40e91d373ba888cce6a0c56de38e3

add migration tests for enum/scalar

view details

push time in 4 days

issue commentmypyc/mypyc

Assertion failure when part of expression is unreachable

We raise a runtime error when we hit a block that is marked is_unreachable, but we don't have that information exposed in a nice way when an expression is unreachable.

JukkaL

comment created time in 5 days

issue closedmypyc/mypyc

Implement walrus operator

Probably shouldn't be too hard?

closed time in 5 days

msullivan

push eventpython/mypy

Michael J. Sullivan

commit sha d7672bf7338640b47b28cd7d903fbab1a62d4f3d

[mypyc] Implement the walrus operator My assessment that this would not be too hard was accurate. Fixes mypyc/mypyc#765.

view details

push time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha f086f10f89e096273122fdb23b99ee6fb1fc4768

Be proactive about catching bogus renames (#1906)

view details

push time in 5 days

delete branch edgedb/edgedb

delete branch : check-renames

delete time in 5 days

PR merged edgedb/edgedb

Be proactive about catching bogus renames
+8 -3

0 comment

2 changed files

msullivan

pr closed time in 5 days

create barnchpython/mypy

branch : walrus-mypyc

created branch time in 5 days

PR opened python/mypy

[mypyc] Implement the walrus operator

My assessment that this would not be too hard was accurate.

Fixes #765.

+63 -4

0 comment

5 changed files

pr created time in 5 days

create barnchpython/mypy

branch : frozenset-mypyc

created branch time in 5 days

PR opened edgedb/edgedb

Test/fix renames for aliases, abstract annots, enum/scalar types

Work on #1772.

+96 -18

0 comment

3 changed files

pr created time in 5 days

create barnchedgedb/edgedb

branch : renames-all-day

created branch time in 5 days

create barnchedgedb/edgedb

branch : check-renames

created branch time in 5 days

PR opened edgedb/edgedb

Be proactive about catching bogus renames
+8 -3

0 comment

2 changed files

pr created time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 063ecaf8c4349d8b19c21ed7d9d5f094177e8641

Fix some more between module type move things (#1901) Fix modifying expressions and add more testing. Since types are the only qualified objects that we are claiming working rename support for in #1772, I'm going to declare victory and say fixes #1890 and handle issues in other constructs as I write tests/fix renaming in those.

view details

push time in 5 days

delete branch edgedb/edgedb

delete branch : more-renames

delete time in 5 days

PR merged edgedb/edgedb

Fix some more between module type move things

Fix modifying expressions and add more testing.

Since types are the only qualified objects that we are claiming working rename support for in #1772, I'm going to declare victory and say fixes #1890 and handle issues in other constructs as I write tests/fix renaming in those.

+102 -23

0 comment

2 changed files

msullivan

pr closed time in 5 days

issue closededgedb/edgedb

Renaming between modules broken

CREATE MODULE foo;
CREATE MODULE test;

CREATE TYPE test::Note {
    CREATE PROPERTY note -> str;
};
ALTER TYPE test::Note RENAME TO foo::Note;
DROP TYPE foo::Note;

fails with "cannot drop column id of table "edgedb_363de41f-0ffa-11eb-b2d3-bd7de72d02be"."363e70c1-0ffa-11eb-8f58-83d1b0e048ab" because other objects depend on it".

ALTER TYPE foo::Note DROP PROPERTY note; fails with ERROR: InvalidReferenceError: property 'note' does not exist

Renaming it back to test::Note and both drops will fail with SQL errors.

closed time in 5 days

msullivan

create barnchedgedb/edgedb

branch : more-renames

created branch time in 6 days

PR opened edgedb/edgedb

Fix some more between module type move things

Fix modifying expressions and add more testing.

Since types are the only qualified objects that we are claiming working rename support for in #1772, I'm going to declare victory and say fixes #1890 and handle issues in other constructs as I write tests/fix renaming in those.

+102 -23

0 comment

2 changed files

pr created time in 6 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 84300d9e60b449cc3aa7e1e8246aa93fcb3e5607

Stricter typing for schema.get (#1900) Get rid of the basically unconstrainted output type variable in the type of schema.get(). Explicitly return so.Object when no `type` argument is passed. My motivation for this is that I had run into a few cases where the output type was being inferred as `None` and so code wasn't getting typechecked. And when I spot-checked some other call sites, the first two I picked had the same problem. When I fixed the typing, though, this didn't catch /that/ many places that had been missing type-checking. I had to fix a handful of errors, and running with --warn-unreachable now reports 144 errors instead of 150. So maybe this isn't worth landing? It does give better type checking, just not as impactfully as I had expected.

view details

push time in 6 days

delete branch edgedb/edgedb

delete branch : schema_get

delete time in 6 days

PR merged edgedb/edgedb

Stricter typing for schema.get

Get rid of the basically unconstrainted output type variable in the type of schema.get(). Explicitly return so.Object when no type argument is passed.

My motivation for this is that I had run into a few cases where the output type was being inferred as None and so code wasn't getting typechecked. And when I spot-checked some other call sites, the first two I picked had the same problem. When I fixed the typing, though, this didn't catch /that/ many places that had been missing type-checking. I had to fix a handful of errors, and running with --warn-unreachable now reports 144 errors instead of 150.

So maybe this isn't worth landing? It does give better type checking, just not as impactfully as I had expected.

+137 -119

1 comment

16 changed files

msullivan

pr closed time in 6 days

pull request commentpython/mypy

Create a copy of TypeQuery specialized for bool

Does this change the perf impact at all?

vbarbaresi

comment created time in 6 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 69bda30d61349e89241e52d577656784dfabd797

Reduce the copy-pasting

view details

push time in 6 days

issue openedmypyc/mypyc

Can't decorate an overridden method

import functools

class Foo:
    def f(self, x: int) -> int:
        return x

class Bar(Foo):
    @functools.lru_cache()
    def f(self, x: int) -> int:
        return x + 1

crashes with

  File "/home/sully/src/mypy/mypyc/irbuild/function.py", line 379, in handle_ext_method
    and not is_same_method_signature(class_ir.method_decls[name].sig,
over.py:8: KeyError: 'f'

Typically we don't put decorated functions in the vtable since we invoke them through the API. We should generate native glue wrappers that delegate to the decorated callable object, like we do when allowing interpreted subclasses. (If we implement #481 (storing decorated functions in globals for faster lookup), we should just always use native wrappers to save a dict lookup.)

created time in 6 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha b514bfbab66cb240685f8a289c2387057f08dadc

Bump the catalog version for the volatility change (#1889) This should have gone in with #1853.

view details

Victor Petrovykh

commit sha fc11b77eece0a48fc1377b10015bd000e7797ada

Fix an issue with repeating the same proposed DDL. Some tests went into infinite loops when trying to apply DDL generated by DESCRIBE MIGRATION. This was due to DDL being proposed over and over (as if the previous DDL didn't apply correctly). It appears that the diff was handling missing and default values incorrectly instead. Issue #1772

view details

Victor Petrovykh

commit sha aecd206690268e2ac7fc4444dcc6c7aff9ac487a

Change how inheriting cardinality is determined. Cardinality cannot be changed once it is set, this affects the logic of checking whether it is inherited or not, since it may be inherited and yet also explicitly specified. Issue #1772

view details

Victor Petrovykh

commit sha 3cc0be1174585c20f9e97524aa8115d0e6fea89a

Make sure that migration suggestions account for cardinality changes. SDL migration command was not generating DDL for changing cardinality. Issue #1772

view details

Michael J. Sullivan

commit sha fa49e77afe10aa8fe8c0bded3ce44c0865f57ad1

Fix moving a type between modules in simple cases (#1892) Progess on #1890. It feels like there might be a lot more problems here, so I'm leaving it open until I write some more tests.

view details

Elvis Pranskevichus

commit sha c95798787f117ad7024fac951d60c5d842421ddf

Fix source version resolution when cwd is somewhere else (#1899) Our `scm_version_scheme` implementation currently only works if the current working directory is within the correct repo, which it might not always be.

view details

Elvis Pranskevichus

commit sha e11a528f991b25e96836f738640109cd37163b76

Add support for chained schemas The new `ChainedSchema` implementation added here takes two regular schemas and chains them together a-la `ChainMap`. This is necessary to separate the read-only `std` portion of schema from user-defined schema in order to save on serialization cost of transmitting the schema over RPC.

view details

Elvis Pranskevichus

commit sha 962ecf9d2b531de90b701dfb02226f608e908599

Make Object and ObjectCollection use __slots__ The `Object` and `ObjectCollection` types are merge wrappers around a `UUID` value and a tuple of `UUID` values correspondingly and so the removal of an object dictionary should help with memory use. Additionally, this makes the `__setattr__` hack blocking direct attribute assignments unnecessary.

view details

Elvis Pranskevichus

commit sha 7f02f26cf14bd6bb45e9c73985b4089b551a2a8d

Stop using identity comparison for schema objects Identity comparison will stop working once we switch to lazy schema object instantiaion in the schema.

view details

Michael J. Sullivan

commit sha c5bcc22d49714b5d1baefca710e93367ad4a0212

Stricter typing for schema.get Get rid of the basically unconstrainted output type variable in the type of schema.get(). Explicitly return so.Object when no `type` argument is passed. My motivation for this is that I had run into a few cases where the output type was being inferred as `None` and so code wasn't getting typechecked. And when I spot-checked some other call sites, the first two I picked had the same problem. When I fixed the typing, though, this didn't catch /that/ many places that had been missing type-checking. I had to fix a handful of errors, and running with --warn-unreachable now reports 144 errors instead of 150. So maybe this isn't worth landing? It does give better type checking, just not as impactfully as I had expected.

view details

Michael J. Sullivan

commit sha 30231186580f2b8732ba2c7945cd777bb32e7dbb

Reduce the copy-pasting

view details

push time in 6 days

create barnchedgedb/edgedb

branch : schema_get

created branch time in 6 days

PR opened edgedb/edgedb

Stricter typing for schema.get

Get rid of the basically unconstrainted output type variable in the type of schema.get(). Explicitly return so.Object when no type argument is passed.

My motivation for this is that I had run into a few cases where the output type was being inferred as None and so code wasn't getting typechecked. And when I spot-checked some other call sites, the first two I picked had the same problem. When I fixed the typing, though, this didn't catch /that/ many places that had been missing type-checking. I had to fix a handful of errors, and running with --warn-unreachable now reports 144 errors instead of 150.

So maybe this isn't worth landing? It does give better type checking, just not as impactfully as I had expected.

+96 -37

0 comment

16 changed files

pr created time in 6 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha fa49e77afe10aa8fe8c0bded3ce44c0865f57ad1

Fix moving a type between modules in simple cases (#1892) Progess on #1890. It feels like there might be a lot more problems here, so I'm leaving it open until I write some more tests.

view details

push time in 6 days

delete branch edgedb/edgedb

delete branch : module-move

delete time in 6 days

PR merged edgedb/edgedb

Fix moving a type between modules in simple cases

Progess on #1890.

It feels like there might be a lot more problems here, so I'm leaving it open until I write some more tests.

+55 -16

0 comment

5 changed files

msullivan

pr closed time in 6 days

issue openedmypyc/mypyc

Implement walrus operator

Probably shouldn't be too hard?

created time in 7 days

push eventpython/mypy

Nils K

commit sha 6bbc8c5e4f48f8ec2988c7ce70ec41b61475b9da

Add typing.OrderedDict to type_aliases (#9389) Co-authored-by: Michael Sullivan <sully@msully.net>

view details

push time in 8 days

PR merged python/mypy

Add typing.OrderedDict to type_aliases

Description

In 3.7.2 typing.OrderedDict was added to the typing module. Beforehand the correct way to annotate an OrderedDict was as a string or using the __future__ import. However since it has been added to the stdlib it has not been added to the type_aliases for mypy as it should have.

Sample File

from typing import OrderedDict

# substituting with collections.OrderedDict soothes mypy but fails at runtime
d: OrderedDict[str, int] = OrderedDict()
$ mypy test.py
test.py:3: error: Variable "typing.OrderedDict" is not valid as a type
test.py:3: note: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
test.py:3: error: "_Alias" not callable
Found 2 errors in 1 file (checked 1 source file)

Test Plan

I do not know if the other aliases are tested anywhere. If so it might be a good idea to add a test there...

+29 -10

7 comments

2 changed files

septatrix

pr closed time in 8 days

push eventseptatrix/mypy

Michael Sullivan

commit sha 429efe21defe023cfcc270b7d0ffa823f6fcd7a7

lurr

view details

push time in 8 days

pull request commentpython/mypy

Add typing.OrderedDict to type_aliases

Alright I applied some brute force to fix this issue, which is annoying. There should be a better way to fix it.

septatrix

comment created time in 8 days

push eventseptatrix/mypy

Guido van Rossum

commit sha 9d038469d80e36057c77e0a8a18831f829778f9d

Add MYPY_CONFIG_FILE_DIR to environment when config file is read (2nd try) (#9414) (This fixes the mistake I introduced in the previous version.) Resubmit of #9403. Fixes #7968. Co-authored-by: aghast <aghast@aghast.dev>

view details

Shantanu

commit sha b9062faa5019c94312fa1d865b40e3252f375b1f

Sync typeshed (#9417) Co-authored-by: hauntsaninja <>

view details

Jake Bailey

commit sha bbd6677a51326bf7397ca7ff13f58d3a26ebae6c

Update int_pow test to match new overloads (#9415)

view details

Xuanda Yang

commit sha 720b77e2ded8c46b66647cdde9218769d33aec41

Supports __future__.annotations (#7963) This PR partially addresses #7907.

view details

Shantanu

commit sha b4c5b804025680e26ab9e1c50990a3f24067a036

semanal: populate module_public even for missing modules (#8661) Fixes #8649 Co-authored-by: hauntsaninja <>

view details

Shantanu

commit sha e959952d9001e9713d329a2f9b196705b028f894

stubtest: use allowlist instead of whitelist (#9426) Allows use of the old options to preserve backwards compatibility A step towards https://github.com/python/typeshed/issues/4436 Co-authored-by: hauntsaninja <>

view details

Shantanu

commit sha ec76ccafa757c6d8fbb2c83195170bf75e0ff324

pep612: more semantic analysis for paramspec (#9422) Linking #8645 Like #9339, much of this is in #9250. However, this PR is a little less self contained, in that it causes several future TODOs. A lot of the changes here are necessitated by changing the type of CallableType.variables to Sequence[TypeVarLikeDef]. This is nice, because it informs me where I need to make changes in the future / integrates a little bit better with existing type var stuff.

view details

Hugues

commit sha d7553fe181f91b6bbf100ca16db83f67690e669a

Fix search paths for `-p` (#9387) `-p` is similar to `-m` except that it will recursively typecheck submodules. Unfortunately the early module walk was being done with search paths that did not benefit from site_packages for the selected python executable, which resulted in some packages being typechecked fine with `-m`, but rejected as `not found` by `-p`. Fixes #9386

view details

Xuanda Yang

commit sha d066e4498b99a078c25fa44fcc2c4876daeaeacc

[mypyc] Merge new_list_op and new_set_op (#9378) This PR builds new_list_op in irbuild. For empty list, we introduce a c_custom_op to do the job. To set the following list item, we rely on pointer addition and SetMem.

view details

Xuanda Yang

commit sha f743b0af0f62ce4cf8612829e50310eb0a019724

[mypyc] Merge type_is_op (#9379) This PR merges type_is_op directly in irbuild. This PR also changes LoadMem so that all LoadMems borrow values

view details

Guido van Rossum

commit sha 6f07cb6a2e02446b909846f99817f674675e826e

Make the new bug templates less markup-heavy (#9438) - Remove emoji - Instead of `## H2 headings` just use `**bold**` - Add link to docs - Add suggestion for new users not to file a bug

view details

Kamil Turek

commit sha 4325aae8ba2231eafd50331e2b9ee22b52a5cf61

Inform about no explicit export instead of attribute suggestions (#9237)

view details

Bryan Forbes

commit sha b707d297ce7754af904469c8bfdf863ffa75492d

Recognize -stubs directories as valid package directories (#9445) Fixes #8229

view details

Matt Gilson

commit sha 37777b3f52560c6d801e76a2ca58b91f3981f43f

Predict enum value type for unknown member names (#9443) It is very common for enums to have homogenous member-value types. In the case where we do not know what enum member we are dealing with, we should sniff for that case and still collapse to a known type if that assumption holds. Handles auto() too, even if you override _get_next_value_.

view details

Jelle Zijlstra

commit sha 44a96876c9f2303af8258532f99cd821a98112dc

types overlap only if all type args match (#9452) Fixes #9451

view details

Nils K

commit sha ccbcfdd9d58e39864af1ad728456226da9f3dfc3

Catch BrokenPipeError in `__main__.py` to avoid extraneous output (#9453) This avoids printing a traceback and additional warnings about BrokenPipeError in situations like ``` mypy file_with_errors.py | head -n 3 ```

view details

Kamil Turek

commit sha 0a2859c33b819d1404d4d1fde66003f0a99f95ad

Consider AnyType for TypeVar upperbound to avoid missing attribute (#9462) Fixes #4351 Using TypeVar upperbound with imported type and disabled imports following was causing missing attribute error since AnyType was not considered as upperbound option.

view details

Momoko Hattori

commit sha f632cbda0b620b8641c0583c91a59cbc35d9b7e7

Add missing operators to BINARY_MAGIC_METHODS (#9439) Closes #9296. Added __[i,r]truediv__ to BINARY_MAGIC_METHODS so that mypy can recognize that the arguments of these methods are positional-only. I also added __[i,r]matmul__ because they were missing too. Please let me know if that was unnecessary.

view details

Eisuke Kawashima

commit sha eb50379defc13cea9a8cbbdc0254a578ef6c415e

Sort mypy.options.PER_MODULE_OPTIONS and fix typo (#9469)

view details

Kamil Turek

commit sha 31862816ee87afc2b7514aec76249b884a9fdbef

Check __setattr__ when property is not settable (#9196) * Create test for __setattr__ usage with property * Check __setattr__ before calling read_only_property * Look through MRO for setattr definition * Create test case with setattr and incompatible type assignment

view details

push time in 8 days

PullRequestEvent

PR closed python/mypy

Add typing.OrderedDict to type_aliases

Description

In 3.7.2 typing.OrderedDict was added to the typing module. Beforehand the correct way to annotate an OrderedDict was as a string or using the __future__ import. However since it has been added to the stdlib it has not been added to the type_aliases for mypy as it should have.

Sample File

from typing import OrderedDict

# substituting with collections.OrderedDict soothes mypy but fails at runtime
d: OrderedDict[str, int] = OrderedDict()
$ mypy test.py
test.py:3: error: Variable "typing.OrderedDict" is not valid as a type
test.py:3: note: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
test.py:3: error: "_Alias" not callable
Found 2 errors in 1 file (checked 1 source file)

Test Plan

I do not know if the other aliases are tested anywhere. If so it might be a good idea to add a test there...

+9 -3

6 comments

3 changed files

septatrix

pr closed time in 8 days

pull request commentpython/mypy

Add typing.OrderedDict to type_aliases

Yeah mypyc is obnoxiously fiddly about conditional compilation stuff. That part of the code seems to be a distraction, though; there's no real need to change anything about how mypy uses OrderedDict. The bigger problem here is that the change doesn't actually fix the problem, unfortunately. Something weirder is going on with these aliases.

septatrix

comment created time in 8 days

pull request commentpython/mypy

Add support to pyproject.toml

Alright, if anybody is excited about picking this up (@erikkemperman?), let me know. Otherwise I'll close the PR in a week or so. (It'll be available for anybody to pick back up still, of course.)

pslacerda

comment created time in 8 days

Pull request review commentpython/mypy

Enforce annotation when inferred item in list, dict or set is object type

 def add_invertible_flag(flag: str,         '--strict', action='store_true', dest='special-opts:strict',         help=strict_help) +    forbidden_inference_group = parser.add_argument_group(+        title='Handling forbidden inference related type checks',+        description="Warn when infered type is List[object], Set[Object] or Dict[*, Object].")+    add_invertible_flag('--suppress-need-type-annotation-errors', default=True,

Please make this more consistent with other options. How about warn-implicit-object-collection as the name for when warning is enabled.

ChetanKhanna

comment created time in 8 days

Pull request review commentpython/mypy

Enforce annotation when inferred item in list, dict or set is object type

 def __init__(self) -> None:         # Apply strict None checking         self.strict_optional = True +        # Testing new flag

This comment doesn't make sense; I'd drop it and move this up with other related things

ChetanKhanna

comment created time in 8 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventpython/mypy

Hugues

commit sha e145ba840db73e60af2dc84379cb25ec08fad455

Speed up typechecking of dict, set and list expressions (#9477) Typechecking of dict, set, and list literals currentlly goes through typechecking of the generic dict/set/list constructor internally. This is usually fine but becomes horrendously slow when the number of items is large: - for generic methods, `infer_arg_types_in_context` is called twice - `infer_arg_types_in_context` is O(n**2) where `n` is the number of arguments, which, in the case of a literal, is the number of items. Add an `O(n)` fast path for deriving the type of simple container literal expressions. This fast path only handle a subset of cases but it provides a tremendous speedup for the relatively common case of large literal constants. The real-world example that motivated this change is a 1889 lines long dict constant representing the parsed value of a mock JSON response from a 3rd party service, where typechecking previously took upwards of 50s and is now down to under 1s with this fast path.

view details

push time in 8 days

PR merged python/mypy

Speed up typechecking of dict, set and list expressions

Typechecking of dict, set, and list literals currently goes through typechecking of the generic dict/set/list constructor internally. This is usually fine but becomes horrendously slow when the number of items is large:

  • for generic methods, infer_arg_types_in_context is called twice
  • infer_arg_types_in_context is O(n**2) where n is the number of arguments, which, in the case of a literal, is the number of items.

Add an O(n) fast path for deriving the type of simple container literal expressions. This fast path only handle a subset of cases but it provides a tremendous speedup for the relatively common case of large literal constants.

The real-world example that motivated this change is a 1889 lines long dict constant representing the parsed value of a mock JSON response from a 3rd party service, where typechecking previously took upwards of 50s and is now down to under 1s with this fast path.

+81 -0

2 comments

1 changed file

huguesb

pr closed time in 8 days

pull request commentpython/mypy

Speed up typechecking of dict, set and list expressions

Thank you!

huguesb

comment created time in 8 days

PullRequestReviewEvent

PR closed python/mypy

Reviewers
Add plugin to typecheck functools.total_ordering

This PR adds a plugin to typecheck classes decorated with functools.total_ordering, as requested in #4610 .

  • The plugin validates the preconditions of @total_ordering (that the class must define __eq__ and one other dunder inequality methods)
  • Unit test cases are added
+120 -0

3 comments

5 changed files

aecay

pr closed time in 8 days

pull request commentpython/mypy

Add plugin to typecheck functools.total_ordering

Closing this because the author felt it was a worse base to work from than #7831. (Which I will probably also close.) Feel free to pick it back up though.

aecay

comment created time in 8 days

push eventpython/mypy

Brian Mboya

commit sha e815e488fc574034592e5de5323a00fe8edc733a

Add gray color ANSI escape sequence (#9071)

view details

push time in 8 days

PR merged python/mypy

Add gray color ANSI escape sequence

Including ANSI escape sequence for gray color that is visible in both light and dark schemed terminal. The idea is to elimate the dim color attribute and replace it with gray color that is good for both light and dark scheme terminal to make the output much more predictable. Below screenshots show how these changes improves the error view.

  • Before on dark theme using dim capname

before_on_dark_theme

  • After on dark theme using gray color

after_on_dark_theme

  • Before on light theme using dim capname

before_on_light_theme

  • After on light theme gray color

after_on_light_theme

+11 -13

4 comments

1 changed file

asheux

pr closed time in 8 days

PR closed python/mypy

Fix 3903: untyped defs on derived classes

fix https://github.com/python/mypy/issues/3903 Looked simple enough, but not sure about the part:

if not defn.info:
           return None

If removed, produces AssertionErrors

+219 -7

6 comments

5 changed files

gantsevdenis

pr closed time in 8 days

pull request commentpython/mypy

Fix 3903: untyped defs on derived classes

I'm going to close this because it has been open with changes requested for quite some time. Anyone should feel free to pick it back up, though!

gantsevdenis

comment created time in 8 days

push eventpython/mypy

Roland van Laar

commit sha 8c2ea0fcbfde98c24039dd271e505beb04dae25c

Update FAQ to include MyPy not working on PyPy (#8879) Co-authored-by: Michael J. Sullivan <sully@msully.net>

view details

push time in 8 days

PR merged python/mypy

Update FAQ to include MyPy not working on PyPy

I experienced a wild goose chase while experimenting with PyPy. It boiled down to typed_ast not compiling with PyPy.

I hope others will find this information more quickly now.

+7 -0

0 comment

1 changed file

rvanlaar

pr closed time in 8 days

push eventrvanlaar/mypy

Michael J. Sullivan

commit sha 38dd183122c96a41699fbac1f4fb427566bca4e2

Update faq.rst

view details

push time in 8 days

issue commentmypyc/mypyc

Get rid of RaiseStandardError?

I think your argument in favor of it when I wanted to get rid of it was that it reduced code size. But I agree, not needed.

JukkaL

comment created time in 8 days

PR closed python/mypy

implement @no_type_check for class defs

Fixes #607 (which is incorrectly titled).

This adds TypeInfo.is_no_type_check, and enables TypeInfo.fallback_to_any for classes decorated with @no_type_check, which is checked in a couple of places to abort the type checker early and stub method types as Any.

I'm not sure confident about my use of decorator.name in ('no_type_check', 'typing.no_type_check' in semanal.py. I see RefName.fullname = 'typing.no_type_check' was used elsewhere but it wasn't a RefName in the AST during semanal and I didn't look too far into that.

This is my current test:

from typing import no_type_check, Any

@no_type_check
class TestClass:
    bar: {'x': 1} = 1

    def meth1(): pass
    def meth2(a: {'x': 1}) -> {'x': 1}:
        def garbage_inner(a: {'x': 1}):
            pass

    def test(a: int): pass

TestClass().test(1)
TestClass().doesntexist()

class Test(TestClass):
    def test2(self, a: int): pass

t = Test()
t.meth1()
t.doesntexist2()
t.test(1)
t.test2(1)

x: int = TestClass().bar

With @no_type_check, mypy throws a Missing return statement for the nested garbage_inner definition, but suppresses the rest of the type errors for this class and subclass.

Without @no_type_check, we get this nice pile of errors:

repro.py:4: error: Invalid type comment or annotation
repro.py:6: error: Method must have at least one argument
repro.py:7: error: Invalid type comment or annotation
repro.py:8: error: Invalid type comment or annotation
repro.py:11: error: Self argument missing for a non-static method (or an invalid type for self)
repro.py:13: error: Too many arguments for "test" of "TestClass"
repro.py:14: error: "TestClass" has no attribute "doesntexist"
repro.py:21: error: "Test" has no attribute "doesntexist2"
repro.py:22: error: Too many arguments for "test" of "TestClass"

TODO (I'd like advice from core contributors on these):

  • [ ] I think I should write in-tree tests for this, but I could use guidance on that.
  • [ ] confirm my decorator.name check is correct.
  • [ ] is it possible to suppress the no return error?
  • [ ] am I missing any additional obvious class type behavior in my test that should be suppressed/stubbed by the decorator?
+17 -0

4 comments

4 changed files

lunixbochs

pr closed time in 8 days

pull request commentpython/mypy

implement @no_type_check for class defs

I'm going to close this because it is against the old semantic analyzer which is totally gone now. Feel free to redo this against the current code base and I'll review it.

lunixbochs

comment created time in 8 days

issue commentpython/mypy

Allow/disallow pep561 packages

I am a "-0" on this; I don't like adding more complexity to our import system. But also I'd be happy to merge it. Let's make a decision on it so we can resolve #8512.

ethanhs

comment created time in 8 days

PR closed python/mypy

Require explicit annotations for List[object] and Dict[*, object]

This currently breaks mypy typechecking. Including instances like

def get_reachable_graph(root: object) -> Tuple[Dict[int, object],
                                               Dict[int, Tuple[int, object]]]:
    parents = {}
    seen = {id(root): root}

Should seen require explicit annotation, or presumably mypy should be smart enough to figure this out.

(#3816)

+71 -8

8 comments

6 changed files

jxcl

pr closed time in 8 days

pull request commentpython/mypy

Require explicit annotations for List[object] and Dict[*, object]

Closing this in favor of #9051. (Which I'm not sure if it will get merged, but.)

jxcl

comment created time in 8 days

pull request commentpython/mypy

plugins: delete open plugin

@JukkaL @ilevkivskyi what is the damage like for this PR at Dropbox?

hauntsaninja

comment created time in 8 days

PR closed python/mypy

Reviewers
Remove open plugin, not needed with overloaded signatures on typeshed

python/typeshed#3371 adds overloaded signatures for open(), Path.open(), etc. Consequently:

  • Plugins that analyze the signatures of these functions can be removed
  • Tests have to be changed. For instance, reveal_type(open()) now produces error: All overload variants of "open" require at least one argument instead of Too few arguments for "open".

This pull request should probably not be merged before python/typeshed#3371. However, we have a circular dependency: mypy_selftest in the typeshed PR fails because of the issues with mypy tests mentioned above. We can use CI on this PR to make sure the tests will pass on typeshed after merging both PRs.

After python/typeshed#3371 is merged, the typeshed submodule will need to be updated.

+82 -47

5 comments

3 changed files

ilai-deutel

pr closed time in 8 days

pull request commentpython/mypy

Remove open plugin, not needed with overloaded signatures on typeshed

I'm sorry about this, but I'm going to close this in favor of #9275. (Which I'm also not sure if it is going to get merged)

ilai-deutel

comment created time in 8 days

push eventpython/mypy

Jakub Stasiak

commit sha 0b865c907921a438c9e129dfc819b09a945a1509

Exclude cache directories from backups using CACHEDIR.TAG (#9018) This helps to prevent bloating backups with caches. See https://bford.info/cachedir/ for more information about the specification – it's supported by attic.

view details

push time in 8 days

PR merged python/mypy

Exclude cache directories from backups using CACHEDIR.TAG

This helps to prevent bloating backups with caches.

See https://bford.info/cachedir/ for more information about the specification – it's supported by Borg, restic, GNU Tar and other solutions.

+24 -0

3 comments

3 changed files

jstasiak

pr closed time in 8 days

PullRequestReviewEvent

pull request commentpython/mypy

Enforce annotation when inferred item in list, dict or set is object type

Not saying we shouldn't do this, but since this has the potential to be a disruptive change, I ran mypy_primer on it: mypy_primer --repo https://github.com/ChetanKhanna/mypy.git --new issue-3816 --old 6ee562a8f3e69 -o concise --clear. It looks like it's around 325 new errors in 4M lines of code, which is concerning for a fix meant to improve usability. Fwiw, a quick skim indicates most of the new errors are for dicts.

Yeah, I would definitely not take this if it wasn't behind a flag. But that does raise a question about whether it is worth adding a flag for this. @JukkaL @ilevkivskyi thoughts?

ChetanKhanna

comment created time in 8 days

push eventasheux/mypy

Xuanda Yang

commit sha 88eb84ec182c3e638aa15fe0ce7c9673059def7b

[mypyc] Implement new-style builtins.len for all supported types (#9284) This PR completes the support of the new style builtins.len for dict, set, tuple and generic cases.

view details

Callum Wilkinson

commit sha d0711bd33db2828529b062aabe41c1ea004546d1

Add support for --enable-error-code and --disable-error-code (#9172) Add ability to enable error codes globally from the command line Add ability to disable error codes globally from the command line Enabling error codes will always override disabling error codes Update documentation to include new flags Fixes #8975.

view details

Jukka Lehtosalo

commit sha 6e41508d3953d8ecb97218a263a1cc625400f477

Sync typeshed (#9285)

view details

Jukka Lehtosalo

commit sha ab5b0ea1fcc099fce3241d8393f0dab24fa67ecf

Sync typeshed (#9289)

view details

Xuanda Yang

commit sha d94853d74077ff5ce50da311d792da546f4e6c38

[mypyc] Implement LoadAddress (#9287) This PR introduces LoadAddress, an op for taking the address of a given name. Currently, in mypyc we only need to take the address of a name when we are using the name_ref_ops, so the op takes a string (CPython name) as its argument. We can revisit the design later if we want to take the address of arbitrary name later.

view details

Xuanda Yang

commit sha b34f4c6b9c2aca899c81c125b8a38b9f2c94c121

[mypyc] Merge most name_ref_op with LoadAddress (#9293) This PR replaces name_ref_op: int, str, list, type, NotImplemented with LoadAddress. The only three remaining name_ref_ops are true, false and none, which should be built directly in irbuild

view details

Xuanda Yang

commit sha 0dfac58ede61f7c4a92f55ffe5f527fa6781fab2

[mypyc] Build True, False and None op in irbuild (#9294) This PR builds three specialized op directly in irbuild, instead of using name_ref_ops.

view details

Xuanda Yang

commit sha ce2a2168ce0a8d6d2bec604dbcba595fdaf968e9

[mypyc] New style new_tuple_op (#9298) This PR supports new-style new_tuple_op, which completes the support of all tuple ops.

view details

Jukka Lehtosalo

commit sha 049a879504273e1f37d530af0abebca4174045fa

[mypyc] Don't free target of LoadMem too early (#9299) Add optional reference to the object from which we are reading from to `LoadMem` so that the object won't be freed before we read memory. Fixes mypyc/mypyc#756.

view details

Xuanda Yang

commit sha bdc5afb01a6df77be1dd569145f8514b5bdc895d

[mypyc] Fix to_lines to show same type registers on the same line (#9300) This PR fixes Environment.to_lines so that continuous registers with the same type are shown on the same line.

view details

Jukka Lehtosalo

commit sha fbc45aabdf46c820e81e3fc85e3d50b3ebf28ad0

Don't simplify away Any when joining unions (#9301) Previously join of `Union[int, Any]` and `Union[int, None]` could be `Union[int, None]` (we lost the `Any` type). Fix this by replacing a subtype check with a proper subtype check when joining unions.

view details

Michael J. Sullivan

commit sha c2c72da2d378c4f2121236a4e7ce65328bc34f4f

Don't infinite loop on self deps in --follow-imports=normal (#9302) There are situations in complex SCCs where the semantic analyzer will infer self dependencies, which will cause an infinite loop in `dmypy --follow-imports=normal`. It's probably a bug that we do that, and that should be fixed to, but fixing a graph algorithm to not infinite loop on self edges seems like a reasonable thing to do in any case. I don't have a minimized test case yet, and am submitting this without one because it should be harmless and because I want it to get into the release.

view details

Xuanda Yang

commit sha 2e9afec83a5214f4a0eaf57a96034230b8460379

[mypyc] Merge keep_propagating_op and remove unused assert_err_occurred_op (#9303) This PR merges keep_propagating_op and removes unused assert_err_occurred_op. To keep the design unified, we turn to C wrapper function for now. This completes all exception-related ops.

view details

Xuanda Yang

commit sha ea913ac6b31b8498908684cfbc110b72bf64c3ff

[mypyc] Obsolete several old-style registry functions (#9310) This PR merges the generic in and op as well as misc builtins.bool op, and obsoletes unused old-style registry functions: call_void_emit, call_and_fail_emit, call_negative_bool_emit, negative_int_emit, call_negative_magic_emit. A test for generic in and misc builtins.bool is added.

view details

Krzysztof Przybyła

commit sha 77b857468fd48f1bb4962e4a4973884d5c451a4d

Add support for using __bool__ method literal value in union narrowing in if statements (#9297) This adds support for union narrowing in if statements when condition value has defined literal annotations in `__bool__` method. Value is narrowed based on the `__bool__` method return annotation and this works even if multiple instances defines the same literal value for `__bool__` method return type. This PR also works well with https://github.com/python/mypy/pull/9288 and makes below example to work as expected: ```python class A: def __bool__(self) -> Literal[True]: ... class B: def __bool__(self) -> Literal[False]: ... def get_thing() -> Union[A, B]: ... if x := get_thing(): reveal_type(x) # Revealed type is '__main__.A' else: reveal_type(x) # Revealed type is '__main__.B' ``` Partially fixes https://github.com/python/mypy/issues/9220

view details

Ashley Whetter

commit sha e4b4959d4ea505f96c38c4a83ec274e025f07852

Fixed stubgen parsing generics from C extensions (#8939) pybind11 is capable of producing type signatures that use generics (for example https://github.com/pybind/pybind11/blob/4e3d9fea74ed50a042d98f68fa35a3133482289b/include/pybind11/stl.h#L140). A user may also opt to write a signature in the docstring that uses generics. Currently when stubgen parses one of these generics, it attempts to import a part of it. For example if a docstring had my_func(str, int) -> List[mypackage.module_being_parsed.MyClass], the resulting stub file tries to import List[mypackage.module_being_parsed. This change fixes this behaviour by breaking the found type down into the multiple types around [], characters, adding any imports from those types that are needed, and then stripping out the name of the module being parsed.

view details

Shantanu

commit sha 3b57105ef75d8f8f479e1617c035320b80b1bcfa

Sync typeshed (#9317) Co-authored-by: hauntsaninja <>

view details

Xuanda Yang

commit sha df6894b5a9bb1a913e66df87138cd7a240c09fc1

[mypyc] Merge misc object ops (#9320) This PR merges none_object_op and ellipsis_op.

view details

Xuanda Yang

commit sha a6ab0968852a85fb30b57dd61ba22dff1dc36a05

[mypyc] Split BinaryIntOp and introduce ComparisonOp, implements is/is not op (#9313) BinaryIntOp used to represent arithmetic, bitwise and comparison operations on integer operations. However, this design prevents us to compare pointer types and all comparison operations should be of boolean return type while manually specifying this in BinaryIntOp is both verbose and error-prone. This PR splits BinaryIntOp and moves the comparison functionalities to ComparsionOp. Based on the new op, this PR also implements is and is not op.

view details

Akuli

commit sha c231ee4fdca075582e1177a8ecea3f379ccaa784

mention py.typed in missing imports doc (#9324)

view details

push time in 8 days

push eventasheux/mypy

Michael Sullivan

commit sha a5bfdf52ef2c1ac051a4681ac77865d894591fda

delete a comment

view details

push time in 8 days

pull request commentpython/mypy

Add support to pyproject.toml

I took the liberty of rebasing and implementing "If pyproject.toml is tried implicitly, do not produce a diagnostic if it is missing tool.mypy". (I don't plan on picking up any of the other pieces myself.)

pslacerda

comment created time in 8 days

push eventpslacerda/mypy

Jukka Lehtosalo

commit sha 3e6e75e4ff5e256bc910db6801affdd28f84826b

[mypyc] Refactor: move expression IR transform to top-level functions (#8462) Work towards mypyc/mypyc#714.

view details

Jukka Lehtosalo

commit sha 3a4a6927c61036bc9086662b2fb4ad028cf9a9a0

[mypyc] Refactor: move class IR generation to top-level functions (#8463) Work on mypyc/mypyc#714.

view details

Jukka Lehtosalo

commit sha ba1294814cba969fbb27a46e90727642e5c40ff7

[mypyc] Refactor: move function transform to top-level functions (#8464) Work on mypyc/mypyc#714.

view details

Jukka Lehtosalo

commit sha aa5c02a234434aecbaa663ff459940487096a7a1

[mypyc] Refactor: move genops related code to package mypyc.irbuild (#8465) This moves various genops-related modules to `mypyc/irbuild/`. Also rename modules to have names that make sense in the new hierarchy. Module implementations have only minimal changes (update imports etc.). Update documentation and docstrings to refer to the new hierarchy. Rename test files `genops-*` to `irbuild-*`. Work on mypyc/mypyc#714.

view details

Jukka Lehtosalo

commit sha d73182c2eb655cb229d6ee778f046a711fce433f

[mypyc] Refactor: move primitive ops to new package mypyc.primitives (#8466) Closes mypyc/mypyc#715.

view details

Jukka Lehtosalo

commit sha 38830934e815fb3111ccd3992a2ed5b3d0966d76

[mypyc] Refactor: extract class and module IR from mypyc.ops (#8467) These aren't really "ops". Work on mypyc/mypyc#716.

view details

Jukka Lehtosalo

commit sha 6aed4ba118195f939ce97cf3c25e140d4a571ada

[mypyc] Refactor: extract function IR from mypyc.ops (#8468) Work on mypyc/mypyc#716.

view details

Jukka Lehtosalo

commit sha d302262d775b68c65f74889011335d0bc51f2b30

[mypyc] Refactor: extract RType related code from mypyc.ops (#8469) The only trickiness was dealing with cyclic imports that this generated. Work on mypyc/mypyc#716.

view details

Jukka Lehtosalo

commit sha 024f3feec512df0af59f3c3f8e2a495127a117c3

[mypyc] Refactor: move IR implementation to mypyc.ir (#8471) Follow original module names as closely as possible (e.g. mypyc.ops -> mypyc.ir.ops). Closes mypyc/mypyc#716.

view details

Jukka Lehtosalo

commit sha 1cfd9b43aa300fdaee2e306d252ac982a72e5996

[mypyc] Refactor: move mypyc.prebuildvisitor under mypyc.irbuild (#8473) It's conceptually part of the IR transform.

view details

Jukka Lehtosalo

commit sha b5bf5a0c8ce31c9ede6301d83cd6e52c2dd13406

[mypyc] Refactor: move emit related modules to mypyc.codegen (#8472) The modules are unchanged, and I preserved the original module names, except for adding `.codegen` in the middle.

view details

Ivan Levkivskyi

commit sha ca83540ec90a65c006f420a760f287a9e33df968

Sync typeshed (#8488)

view details

Michael J. Sullivan

commit sha df288e410b6d5b2ef568d1064d36e261e77dbd48

[mypyc] add str.__getitem__ primitive op (#8460)

view details

Jukka Lehtosalo

commit sha 41fd871bca18bd9e28b4a7afbaba941afbfe1ef8

Fix fine-grained dependency to "__call__" (#8494) Also fix the inferred type of a callee when we use `__call__`. Previously we stored the callable type inferred from `__call__`, which is incorrect. Fixes #8489.

view details

Michael J. Sullivan

commit sha a6a53e5184296e88b0ba24cb1a11a2f4e5eaa696

Fix incremental mode when non-compiled classes are imported (#8498)

view details

Michael J. Sullivan

commit sha 514dbfbd9984a58081646fcfa6d8a4e9ba979f23

Revert "mypy: remove has_member (#8438)" (#8500) It turns out that the has_member check is an important (accidental?) performance optimization. Removing this caused a major (30+%?) slowdown at dropbox. There might be a better way to optimize this but I'm just going to revert it for now at least. This reverts commit 09cdab4ffd34f89cc02f512fc35fdef57cb4c267.

view details

Mattwmaster58

commit sha d2e984a176f354912f826ebbc589d209f25fd001

Support environment variable interpolation for junit_xml + quickstart_file config keys (#8479) Expands on the goal of #7273 Exactly what the title says. The docs say this: > Some flags support user home directory and environment variable expansion. To refer to the user home directory, use ~ at the beginning of the path. To expand environment variables use $VARNAME or ${VARNAME}. This would add `quickstart_file` and `junit_xml` to the flags that support environment variable expansion. The only downside I see here is if someone decides they want their JUnit XML ouput file or quickstart file something weird like `$file`

view details

Felicián Németh

commit sha 1180a9dfbdf6aef9a9df3a6f7639b3cd42f0be47

Suggest solutions for a typo in a key of a TypedDict (#8483)

view details

Xuanda Yang

commit sha dd9cdca2065d06d3b58663def602cf8f16328cd0

[mypyc] Implement specialized int(str) (#8496) Work on mypyc/mypyc#644.

view details

Michael J. Sullivan

commit sha 818cc4e0ac2b5d17c161fb65547ab77ead23ed28

[mypyc] Support len and index based for loops for tuples, strings (#8503)

view details

push time in 8 days

PullRequestReviewEvent

pull request commentpython/mypy

Continue reading next config file if no mypy section in shared conf

Thanks!

jmetz

comment created time in 8 days

push eventpython/mypy

Jeremy Metz

commit sha cbf7705639b5470b7ed46802dcc91a51d91524d3

Continue reading next config file if no config section in shared config file (#9114)

view details

push time in 8 days

PR merged python/mypy

Continue reading next config file if no mypy section in shared conf

Simple PR to address #9113

+2 -0

0 comment

1 changed file

jmetz

pr closed time in 8 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventpython/mypy

Nikita Sobolev

commit sha 3acbf3fe78a61c19ff96754233ada453472004c4

Adds get_function_signature_hook (#9102) This PR introduces get_function_signature_hook that behaves the similar way as get_method_signature_hook. Closes #9101 Co-authored-by: Michael Sullivan <sully@msully.net>

view details

push time in 9 days

more