UC-Davis-molecular-computing / scadnano-python-package

Python scripting library for generating designs readable by scadnano.
https://scadnano.org
MIT License
13 stars 7 forks source link

Set Position3D as frozen #233

Closed cgevans closed 2 years ago

cgevans commented 2 years ago

Mutable defaults in dataclasses will cause an error in Python 3.11. HelixGroup has a Position3D default. Position3D appears to be intended to be immutable, and is never used mutably in the code, but does not have frozen=True set for the dataclass options. This sets it, and causes tests to pass with Python 3.11.0b4.

Alternatively, Position3D could be left as is, and the HelixGroup position could be made to be position: Position3D = field(default_factory=lambda: Position3D(x=0,y=0,z=0)), but this seems less efficient.