The multi-value cloning bug can be reproduced more simply with this:
==== import bs4 import copy
html_doc = '<p class="foo"/>' soup = bs4.BeautifulSoup(html_doc, "lxml") p1 = soup.find("p") p2 = p1._clone() p1.attrs["class"].append("BAR") # <-- also affects p2
print(f"p1: {p1}") print(f"p2: {p2}") ====
The multi-value cloning bug can be reproduced more simply with this:
====
import bs4
import copy
html_doc = '<p class="foo"/>' up(html_ doc, "lxml") "class" ].append( "BAR") # <-- also affects p2
soup = bs4.BeautifulSo
p1 = soup.find("p")
p2 = p1._clone()
p1.attrs[
print(f"p1: {p1}")
print(f"p2: {p2}")
====