python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.41k stars 2.82k forks source link

RecursionError: maximum recursion depth exceeded #17691

Closed flexatone closed 2 months ago

flexatone commented 2 months ago

Crash Report

While I was having no problems with MyPy 1.10, with MyPy 1.11.0, 1.11.1 I get segmentation faults, and an exception with the code installed as:

pip3 install git+https://github.com/python/mypy@fe15ee69b9225f808f8ed735671b73c31ae1bed8

By avoiding the segfaults, I get a KeyError: 'expr'

Traceback

{.env311-sf}{965/mypy-1.11.1} % mypy
Traceback (most recent call last):
  File "/home/ariza/.env311-sf/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
             ^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/main.py", line 102, in main
    res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/main.py", line 186, in run_build
    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 193, in build
    result = _build(
             ^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 268, in _build
    graph = dispatch(sources, manager, stdout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 2950, in dispatch
    process_graph(graph, manager)
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 3341, in process_graph
    process_fresh_modules(graph, prev_scc, manager)
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 3419, in process_fresh_modules
    graph[id].load_tree()
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/build.py", line 2103, in load_tree
    self.tree = MypyFile.deserialize(data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 402, in deserialize
    tree.names = SymbolTable.deserialize(data["names"])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 4019, in deserialize
    st[key] = SymbolTableNode.deserialize(value)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 3960, in deserialize
    node = SymbolNode.deserialize(data["node"])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 263, in deserialize
    return method(data)
           ^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 3382, in deserialize
    names = SymbolTable.deserialize(data["names"])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 4019, in deserialize
    st[key] = SymbolTableNode.deserialize(value)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 3960, in deserialize
    node = SymbolNode.deserialize(data["node"])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 263, in deserialize
    return method(data)
           ^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/nodes.py", line 1092, in deserialize
    type = None if data["type"] is None else mypy.types.deserialize_type(data["type"])
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 224, in deserialize_type
    return method(data)
           ^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 997, in deserialize
    original_str_expr=data["expr"],
                      ~~~~^^^^^^^^
KeyError: 'expr'

To Reproduce

This results from running MyPy on a large code base that makes heavy use of TypeVarTuple and Unpack. I cannot isolate the issue but this can be reproduced within the following PR:

https://github.com/static-frame/static-frame/pull/966

Your Environment

sobolevn commented 2 months ago

Refs https://github.com/python/mypy/commit/bc39f1714e2e5f39eb90f05f74575a7c397f068b CC @ilevkivskyi

ilevkivskyi commented 2 months ago

Did you somehow managed to use mypy cache from an old mypy version? I thought mypy is smart enough to not do this, unless you are doing something tricky.

flexatone commented 2 months ago

Hi @ilevkivskyi , thank you for looking at this.

Not trying to do anything tricky! I first found the segfault in CI on a clean GitHub Action run.

Running it locally again after explicitly removing .mypy_cache, I do now get a different exception. The exception is long due to the recursion issue; these are the last lines.

Happy to help investigate as needed.

  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 782, in visit_tuple_type
    mypy.typeops.tuple_fallback(left), right
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 117, in tuple_fallback
    info, [make_simplified_union(items)], extra_attrs=typ.partial_fallback.extra_attrs
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 475, in make_simplified_union
    simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 561, in _remove_redundant_union_items
    if is_proper_subtype(
       ^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2447, in accept
    return visitor.visit_tuple_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 781, in visit_tuple_type
    elif self._is_subtype(left.partial_fallback, right) and self._is_subtype(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 412, in _is_subtype
    return is_proper_subtype(left, right, subtype_context=self.subtype_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 222, in is_proper_subtype
    return _is_subtype(left, right, subtype_context, proper_subtype=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 350, in _is_subtype
    return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 1460, in accept
    return visitor.visit_instance(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 604, in visit_instance
    if right.type.is_protocol and is_protocol_implementation(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 1161, in is_protocol_implementation
    subtype = mypy.typeops.get_protocol_member(left, member, class_obj)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/typeops.py", line 1103, in get_protocol_member
    return get_proper_type(find_member(member, left, left, class_obj=class_obj))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 1248, in find_member
    return find_node_type(method, itype, subtype, class_obj=class_obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/subtypes.py", line 1383, in find_node_type
    typ = expand_type_by_instance(typ, itype)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/expandtype.py", line 114, in expand_type_by_instance
    return expand_type(typ, variables)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/expandtype.py", line 69, in expand_type
    return typ.accept(ExpandTypeVisitor(env))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 2004, in accept
    return visitor.visit_callable_type(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/expandtype.py", line 411, in visit_callable_type
    ret_type=t.ret_type.accept(self),
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 1460, in accept
    return visitor.visit_instance(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/expandtype.py", line 229, in visit_instance
    return t.copy_modified(args=args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 1516, in copy_modified
    new = Instance(
          ^^^^^^^^^
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 1399, in __init__
    super().__init__(line, column)
  File "/home/ariza/.env311-sf/lib/python3.11/site-packages/mypy/types.py", line 243, in __init__
    super().__init__(line, column)
RecursionError: maximum recursion depth exceeded
ilevkivskyi commented 2 months ago

OK, now this is interesting. I have an idea of what may be going on, but it may take a while to find repro. Mypy should print file name and line number that caused the crash before the start of the traceback. You can try using this to find a minimal repro.

flexatone commented 2 months ago

Thanks, @ilevkivskyi , for the note on the line number.

I have been able to create reproduceable snippet, below. This code has been around and passing for some time, at least on MyPy 1.9 and 1.10, and I have confirmed again it passes on 1.10. If I remove the recursive union component, the exception goes away.

import typing as tp

TLabel = tp.Union[
        tp.Hashable,
        int,
        bool,
        float,
        complex,
        str,
        bytes,
        None,
        tp.Tuple['TLabel'],
]

TLocSelectorNonContainer = tp.Union[
        TLabel,
        slice,
        tp.List[TLabel],
        ]

def is_slice(value: TLocSelectorNonContainer) -> bool:
    return value.__class__ is slice

Note that the following, simpler example, still using the recursive union, passes without exception.

import typing as tp

TLabel = tp.Union[
        tp.Hashable,
        int,
        bool,
        float,
        complex,
        str,
        bytes,
        None,
        tp.Tuple['TLabel'],
]

def is_none(value: TLabel) -> bool:
    return value is None
ilevkivskyi commented 2 months ago

Yeah, we recently switched tuple fallbacks from joins to unions, this obviously causes this issue.

Btw while I am working on this, using tp.Tuple['TLabel', ...] (i.e. variable length tuple) will likely fix the crash for you (depending on how much this snippet has been simplified).

flexatone commented 2 months ago

Thank you for pointing that out: tp.Tuple['TLabel', ...] was actually my intention all along.

Making that change fixes the crash for me: much appreciated!

ilevkivskyi commented 2 months ago

In the meantime a bit simpler repro is

from typing import Tuple, Union, Hashable, List

TLabel = Union[Hashable, Tuple[TLabel]]
TLabels = Union[TLabel, List[TLabel]]

x: TLabel
xs: TLabels = [x]