Skip to content

Fix mutable-default bug in codegen.config with Python 3.11 and newer

Frederik Hennig requested to merge fhennig/config-fix into v2.0-dev

Since Python 3.11, dataclasses check if default field values are hashable, and if they are not, reject them as mutable. For this reason, the config API using the Category descriptor was broken with Python 3.11, which we didn't see since the CI did not test against 3.11.

This MR

  • Fixes this behavior by circumventing the dataclass mechanism
  • Adds a CI testsuite task using Python 3.13 to detect such errors in the future

Merge request reports