Skip to content

list += operator generates Error #1351

@HyeockJinKim

Description

@HyeockJinKim

Feature

a = [3]
a += a
print(a)

The code above generates the following error:
(list += operator)

actual

Hyeockz:RustPython hyeockjinkim$ cargo run b.py 
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/rustpython b.py`
thread 'main' panicked at 'already mutably borrowed: BorrowError', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

expected

[3, 3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions