Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove potentially dead code from make_simplified_union #15094

Closed
wants to merge 1 commit into from

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Apr 21, 2023

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
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.

None yet

1 participant