# SPDX-License-Identifier: MIT
# Independently authored list mutation, alias and iterable-conversion cases.
values = list((1, 2, 1))
alias = values
values.insert(-1, 9)
print(values.pop(0), values.remove(1), values.count(9), values.index(9), alias)
values.pop()
values.pop()
values.append(7)
values.extend((8, 9))
values += b"\x0a\x0b"
copy = list(values)
copy.remove(9)
print(values, copy, alias is values, copy is values)
print(list("é🙂"), list(b"\x00\xff"), list(()))
mapping = {"red": 1, "blue": 2}
print(list(mapping), list(mapping.items()))
chars = []
chars += "é🙂"
chars.extend(mapping)
print(chars)
try:
    values.index(99)
except ValueError as error:
    print(repr(error))
try:
    values.remove(99)
except ValueError as error:
    print(repr(error))
try:
    values.pop(99)
except IndexError as error:
    print(repr(error))
empty = []
try:
    empty.pop()
except IndexError as error:
    print(repr(error))
child = [1]
parents = [child]
parents.insert(0, child)
removed = parents.pop()
removed.append(2)
print(child, parents, removed is child)
