Skip to content

* is not supported between list[@_] and list[@_] #2529

@superbobry

Description

@superbobry

Describe the Bug

Reproducer:

def untile_axis(out, axis: int | None):
  if axis is None:
    return out
  shape = list(out.shape)
  shape[axis:axis+2] = [shape[axis] * shape[axis+1]]

Output

ERROR `*` is not supported between `list[@_]` and `list[@_]` [unsupported-operation]
 --> /tmp/foo.py:5:25
  |
5 |   shape[axis:axis+2] = [shape[axis] * shape[axis+1]]
  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  Argument `list[@_]` is not assignable to parameter `value` with type `SupportsIndex` in function `list.__mul__`
  Protocol `SupportsIndex` requires attribute `__index__`
ERROR `*` is not supported between `list[list[Unknown]]` and `list[list[Unknown]]` [unsupported-operation]
 --> /tmp/foo.py:5:25
  |
5 |   shape[axis:axis+2] = [shape[axis] * shape[axis+1]]
  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  Argument `list[list[Unknown]]` is not assignable to parameter `value` with type `SupportsIndex` in function `list.__mul__`
  Protocol `SupportsIndex` requires attribute `__index__`
 INFO 2 errors

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions