Skip to content

Slice assignment allows mismatched length in Python 3.12.6 without raising ValueError #136349

Closed as not planned
@AA15421

Description

@AA15421

Bug report

Bug description:

# Add a code block here, if required

Bug Description

#In Python 3.12.6, the following code does not raise an error:

l3 = [2, 3, 4, 5]
l3[::1] = [1, 3]
print(l3) 


Expected:
ValueError: attempt to assign sequence of size 2 to extended slice of size 4 

but showing output [1,3]

### CPython versions tested on:

3.12

### Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions