Skip to content

Remove potentially dead code from make_simplified_union - #15094

Closed
hauntsaninja wants to merge 1 commit into
python:masterfrom
hauntsaninja:simplif
Closed

hauntsaninja wants to merge 1 commit into
python:masterfrom
hauntsaninja:simplif

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Apr 21, 2023 •

Copy link
Copy Markdown
Collaborator

I was looking into optimising a couple code paths. This change is likely incorrect, but unit tests seemed to pass for me locally without this. We should have a test that covers this and hopefully primer reveals one.

@github-actions

Copy link
Copy Markdown
Contributor

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

mypy (https://github.com/python/mypy)
+ mypy/checker.py:1389: error: Left operand of "or" is always false  [redundant-expr]

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/config/findpaths.py:217: error: Right operand of "or" is never evaluated  [unreachable]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/commands/slash.py:808: error: Statement is unreachable  [unreachable]

dragonchain (https://github.com/dragonchain/dragonchain)
+ dragonchain/transaction_processor/level_4_actions.py:119:5: error: Need type annotation for "validations" (hint: "validations: List[<type>] = ...")  [var-annotated]

cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/update.py: note: In function "checkversion":
+ cwltool/update.py:277:5: error: Statement is unreachable  [unreachable]

rich (https://github.com/Textualize/rich)
+ rich/table.py:666: error: Right operand of "or" is never evaluated  [unreachable]
+ rich/table.py:674: error: Right operand of "or" is never evaluated  [unreachable]
+ rich/style.py:713: error: If condition is always true  [redundant-expr]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/runtime.py: note: In member "connect_session" of class "Runtime":
+ lib/streamlit/runtime/runtime.py:368:82: error: Right operand of "or" is never evaluated  [unreachable]

@hauntsaninja
hauntsaninja deleted the simplif branch April 21, 2023 07:50
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Apr 21, 2023
Add a test for the code path exercised in python#15094
JelleZijlstra pushed a commit that referenced this pull request Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant