Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not deepcopy the cache! #158

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/prov/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
PROV-JSON: https://openprovenance.org/prov-json/
"""
from collections import defaultdict
from copy import deepcopy
import datetime
import io
import itertools
Expand Down Expand Up @@ -1177,8 +1176,8 @@ def valid_qualified_name(self, qname):
# reuse the existing namespace
new_qname = existing_ns[local_part]
else:
# Do not reuse the namespace object
ns = self.add_namespace(deepcopy(namespace))
# Do not reuse the namespace object, making an identical copy
ns = self.add_namespace(Namespace(namespace.prefix, namespace.uri))
# minting the same Qualified Name from the namespace's copy
new_qname = ns[qname.localpart]
# returning the new qname
Expand Down