Skip to content

Conversation

@huguesb
Copy link
Contributor

@huguesb huguesb commented Dec 10, 2022

The original implementation was very conservative and bailed whenever a type context
was present, drastically limiting its reach.

There are a number of type contexts where the fast path can safely be taken.
Most importantly:

  • Any
  • matching container types

Fixes #14271

@github-actions

This comment has been minimized.

The original implementation was very conservative and bailed whenever a type context
was present, drastically limiting its reach.

There are a number of type contexts where the fast path can safely be taken.
Most importantly:
 - Any
 - matching container types
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/builder.py: note: In member "generate_arg" of class "Builder":
+ cwltool/builder.py:625:24: error: Redundant cast to "List[str]"  [redundant-cast]

core (https://github.com/home-assistant/core)
- homeassistant/components/litterrobot/sensor.py:83: error: Returning Any from function declared to return "bool"  [no-any-return]
- homeassistant/components/litterrobot/sensor.py:89: error: Returning Any from function declared to return "bool"  [no-any-return]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildly inconsistent performance for seemingly trivial changes to source code

4 participants