Skip to content

Commit

Permalink
Release version 0.0.0.dev42
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Nov 18, 2024
1 parent 21eedbe commit f22d6b6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev41"
version = "0.0.0.dev42"
name = "PySerials"
dependencies = [
"jsonschema >= 4.21.0, < 5",
Expand All @@ -26,8 +26,8 @@ dependencies = [
"ruamel.yaml >= 0.17.32, < 0.18", # https://yaml.readthedocs.io/en/stable/
"ruamel.yaml.string >= 0.1.1, < 1",
"tomlkit >= 0.11.8, < 0.12", # https://tomlkit.readthedocs.io/en/stable/,
"MDit == 0.0.0.dev38",
"ExceptionMan == 0.0.0.dev38",
"MDit == 0.0.0.dev39",
"ExceptionMan == 0.0.0.dev39",
"ProtocolMan == 0.0.0.dev2",
]
requires-python = ">=3.10"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ jsonpath-ng >= 1.6.1, < 2
ruamel.yaml >= 0.17.32, < 0.18
ruamel.yaml.string >= 0.1.1, < 1
tomlkit >= 0.11.8, < 0.12
MDit == 0.0.0.dev38
ExceptionMan == 0.0.0.dev38
MDit == 0.0.0.dev39
ExceptionMan == 0.0.0.dev39
ProtocolMan == 0.0.0.dev2
17 changes: 15 additions & 2 deletions src/pyserials/property_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ def __ne__(self, other):
return self._data != other._data

def __deepcopy__(self, memo):
# Use `deepcopy` on the internal dictionary to copy its contents
# Dynamically handle subclass instantiation with additional arguments
cls = type(self)
# Deepcopy the data dictionary
copied_data = _copy.deepcopy(self._data, memo)
return PropertyDict(copied_data)
# Capture extra attributes (everything except `_data`)
extra_attrs = {
key: _copy.deepcopy(value, memo)
for key, value in self.__dict__.items()
if key != "_data"
}
# Create a new instance
obj = cls.__new__(cls) # Avoid calling __init__ directly
obj._data = copied_data # Set _data directly
# Restore extra attributes
obj.__dict__.update(extra_attrs)
return obj

0 comments on commit f22d6b6

Please sign in to comment.