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

Pint in python3.13 TypeError: cannot inherit frozen dataclass from a non-frozen one #2064

Closed
mgt16-LANL opened this issue Oct 21, 2024 · 1 comment

Comments

@mgt16-LANL
Copy link

mgt16-LANL commented Oct 21, 2024

Hi All,

Running into an issue using Pint in newly released python3.13:
Pasting the error trace below.
`Python 3.13.0 | packaged by conda-forge | (main, Oct 17 2024, 12:32:35) [Clang 17.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pint
Traceback (most recent call last):
File "", line 1, in
import pint
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/site-packages/pint/init.py", line 18, in
from .delegates.formatter._format_helpers import formatter
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/site-packages/pint/delegates/init.py", line 12, in
from . import txt_defparser
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/site-packages/pint/delegates/txt_defparser/init.py", line 12, in
from .defparser import DefParser
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/site-packages/pint/delegates/txt_defparser/defparser.py", line 10, in
from . import block, common, context, defaults, group, plain, system
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/site-packages/pint/delegates/txt_defparser/common.py", line 23, in
@DataClass(frozen=True)
~~~~~~~~~^^^^^^^^^^^^^
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/dataclasses.py", line 1295, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
frozen, match_args, kw_only, slots,
weakref_slot)
File "/Users/mgt16/mambaforge/envs/test_py/lib/python3.13/dataclasses.py", line 1043, in _process_class
raise TypeError('cannot inherit frozen dataclass from a '
'non-frozen one')
TypeError: cannot inherit frozen dataclass from a non-frozen one`

Edit: Pint version:
`# packages in environment at /Users/mgt16/mambaforge/envs/test_py:

Name Version Build Channel

pint 0.24.3 pyhd8ed1ab_0 conda-forge`

@mgt16-LANL
Copy link
Author

Related to PR and previous issue: #2037 . Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant