from dataclasses import dataclass
from typing import Dict
from torch_geometric.config_store import register
@register()
@dataclass
class MyClass1:
something: Dict[str, int]
@register()
@dataclass
class MyClass2:
something: dict[str, int]
Traceback (most recent call last):
File "/home/aki/work/github.com/pyg-team/pytorch_geometric/test_config.py", line 13, in <module>
@register()
^^^^^^^^^^
File "/home/aki/work/github.com/pyg-team/pytorch_geometric/torch_geometric/config_store.py", line 360, in bounded_register
register(cls=cls, data_cls=data_cls, group=group, **kwargs)
File "/home/aki/work/github.com/pyg-team/pytorch_geometric/torch_geometric/config_store.py", line 345, in register
data_cls = to_dataclass(cls, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aki/work/github.com/pyg-team/pytorch_geometric/torch_geometric/config_store.py", line 255, in to_dataclass
annotation = map_annotation(annotation, mapping=MAPPING)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aki/work/github.com/pyg-team/pytorch_geometric/torch_geometric/config_store.py", line 170, in map_annotation
annotation.__args__ = tuple(map_annotation(a, mapping) for a in args)
^^^^^^^^^^^^^^^^^^^
AttributeError: readonly attribute
Fixes this error: