Whole-known-network
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@dabeaz" class="u-url mention">@<span>dabeaz</span></a></span> Yeah, definitely looks hackey. _Does_ have type hints these days, though.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@tekknolagi" class="u-url mention">@<span>tekknolagi</span></a></span> Ew is right.</p>
<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>
<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, (), {'__annotations__': anns, **anns}))<br /> globals()[name] = ty<br /> return ty</p><p>d('Point', {'x': int, 'y': int})</p><p>but ew...</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@dabeaz" class="u-url mention">@<span>dabeaz</span></a></span> Like in the named tuples?</p>
<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@fasterthanlime" class="u-url mention">@<span>fasterthanlime</span></a></span> I still don't really get it even with the ELI5.</p><p>Does it intersect with the problem I have doing web development with askama? -> Updating any template requires the project to rebuild which takes too long to immediately refresh the page.</p>
<p><span class="h-card" translate="no"><a href="https://functional.cafe/@loke" class="u-url mention">@<span>loke</span></a></span> It will be in the weeks after the user meeting. It will be a phased release. We'll be posting here when this starts.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@dabeaz" class="u-url mention">@<span>dabeaz</span></a></span></p><p>struct Point { x: i32, y: i32 }</p><p>Oh, sorry, wrong language.</p>
<p>Article updated to note their new official FAQ. Notes at the top of the article.</p>