<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 14 September 2017 at 22:07, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For comparison's sake, what would the above look like using __class__ assignment?  And what is the performance difference?<br>
<br></blockquote><div><br></div><div>FWIW I found a different solution:</div><div><br></div><div># file mod.py</div><div><br></div><div>from typing_extensions import allow_forward_references</div><div>allow_forward_references()</div><div>from mod import Vertex, Edge  # the import is from this same module.</div><div><br></div><div>It works both with __class__ assignment and with __getattr__<br></div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></div></div></div>