You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/__main__.py", line 37, in <module>
console_entry()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/__main__.py", line 15, in console_entry
main()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/main.py", line 109, in main
res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/main.py", line 193, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 194, in build
result = _build(
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 269, in _build
graph = dispatch(sources, manager, stdout)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 2936, in dispatch
process_graph(graph, manager)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 3334, in process_graph
process_stale_scc(graph, scc, manager)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 3435, in process_stale_scc
graph[id].type_check_first_pass()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/build.py", line 2305, in type_check_first_passself.type_checker().check_first_pass()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checker.py", line 483, in check_first_passself.accept(d)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checker.py", line 592, in accept
stmt.accept(self)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/nodes.py", line 1297, in acceptreturn visitor.visit_expression_stmt(self)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checker.py", line 4547, in visit_expression_stmt
expr_type =self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True)
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checkexpr.py", line 5885, in accept
typ = node.accept(self)
^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/nodes.py", line 2043, in acceptreturn visitor.visit_index_expr(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checkexpr.py", line 4318, in visit_index_expr
result =self.visit_index_expr_helper(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checkexpr.py", line 4334, in visit_index_expr_helperreturnself.visit_index_with_type(left_type, e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checkexpr.py", line 4369, in visit_index_with_typereturnself.visit_tuple_slice_helper(left_type, index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/checkexpr.py", line 4495, in visit_tuple_slice_helper
item = left_type.slice(b, e, s, fallback=self.named_type("builtins.tuple"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/types.py", line 2549, in slice
slice_items =self.items[begin:end:stride]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^ValueError: slice step cannot be zero
main.py:1: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.14.0+dev.2d785dffee4440b9e5fd4c4f7dbf8787a829f5fa
main.py:1: : note: use --pdb to drop into pdb
Your Environment
Mypy version used: 1.14.0+dev.2d785dffee4440b9e5fd4c4f7dbf8787a829f5fa
Python version used: 3.13
The text was updated successfully, but these errors were encountered:
AlexWaygood
changed the title
Crash when checking subscript expression with 0 used for the step
Crash when checking slice expression with 0 used for the stepOct 28, 2024
Crash Report
Originally discovered by @sharkdp: mypy crashes when type checking a module containing just the following:
()[::0]
Playground link
Traceback
Your Environment
The text was updated successfully, but these errors were encountered: