Skip to content

Nondeterminism observed on pandas in typeshed primer #21445

@hauntsaninja

Description

@hauntsaninja

mypy_primer in typeshed has started flakily showing the introduction or removal of an error on pandas.

This typically looks like:

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/computation/ops.py:328: error: Need type annotation for "_binary_ops_dict" (hint: "_binary_ops_dict: dict[<type>, <type>] = ...")  [var-annotated]

You can see this in a number of typeshed PRs https://github.com/python/typeshed/pulls?q=is%3Apr+_binary_ops_dict

Here's an example error from April 7 python/typeshed#15622 (comment). Typeshed updated to 1.20 on April 1.

The interesting thing is I suspect this will not repro with stock mypy (e.g. we haven't seen it in mypy's mypy_primer)

I think what is going in is that you also need these typeshed PRs to operator.py. I reverted these PRs for us because they are bad for our users (for other reasons): #21232 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions