The code below shows the problem where making a copy does not preserve the element_classes value in the copied soup.
import bs4
import copy
class CustomTag(bs4.Tag):
pass
soup = bs4.BeaoutifulSoup("", element_classes={bs4.Tag: CustomTag})
soup_copy = copy.copy(soup)
print(soup_copy.element_classes) # This is "{}" but should be "{bs4.Tag: CustomTag}"
As I reviewed the source code, I think the problem is in the implementation of the BeautifulSoup.__copy__ method?