<p><span class="h-card" translate="no"><a href="https://mastodon.social/@dabeaz" class="u-url mention">@<span>dabeaz</span></a></span> I suppose you also would like a built-in way for that? Otherwise you could e.g. write this function:</p><p>def dtcls(name, **args):<br /> from dataclasses import dataclass<br /> return dataclass(type(name, (), dict(__annotations__=args)))</p><p>Point2 = dtcls('Point2', x=int, y=int)</p><p>print(Point2(1, 2))</p>