Closed modularizer closed 1 year ago
I am not sure what the better approach is: adding the __hash__
method here, or modifying DFXCore.vlnv
to use dataclasses.field
with a keyword argument of default_factory
which takes in a function which creates a Vlnv instance
Looks great, thanks for the contribution @modularizer. Can you change the base of the PR to v0.1.6? Then I'll add a python3.11 test to the github workflow.
A breaking change in Python3.11 is to "Change field default mutability check, allowing only defaults which are hashable instead of any object which is not an instance of dict, list or set. (Contributed by Eric V. Smith in bpo-44674.)", see https://docs.python.org/3/whatsnew/3.11.html#dataclasses.
This makes it so Vnlv cannot be used as a default argument for DFXCore.vlnv and
import pynqmetadata
fails when using Python3.11, as doesimport pynq
The ways to fix are either to:
in order to avoid the error...
After either one of these changes,
import pynqmetadata
works in Python3.11.