Skip to content

Commit 891210b

Browse files
daiyippyglove authors
authored andcommitted
Enable dataclasses_transform (PEP 681) on pg.ObjectMeta for better static typing support.
PiperOrigin-RevId: 791418828
1 parent c080ff4 commit 891210b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyglove/core/symbolic/object.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
from pyglove.core.symbolic import flags
2929

3030

31+
if sys.version_info >= (3, 11):
32+
_dataclass_transform = typing.dataclass_transform
33+
else:
34+
_dataclass_transform = lambda x: x
35+
36+
37+
@_dataclass_transform()
3138
class ObjectMeta(abc.ABCMeta):
3239
"""Meta class for pg.Object."""
3340

0 commit comments

Comments
 (0)