import copy
from requests_toolbelt.sessions import BaseUrlSession
class MyClass:
def __init__(self, url):
self.session = BaseUrlSession(base_url=url)
o = MyClass(url='https://httpbin.org')
print(o.session.base_url) # outputs: https://httpbin.org
copied = copy.deepcopy(o)
print(copied.session.base_url) # outputs: None