<p><span class="h-card" translate="no"><a href="https://mastodon.social/@dabeaz" class="u-url mention">@<span>dabeaz</span></a></span> If you are willing to have support code,</p><p>def d(name, anns):<br /> ty = dataclass(type(name, (), {&#39;__annotations__&#39;: anns, **anns}))<br /> globals()[name] = ty<br /> return ty</p><p>d(&#39;Point&#39;, {&#39;x&#39;: int, &#39;y&#39;: int})</p><p>but ew...</p>
Reply