<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 1 December 2017 at 00:34, Ilya Kulakov <span dir="ltr"><<a href="mailto:kulakov.ilya@gmail.com" target="_blank">kulakov.ilya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div>Anyway, my expectation is that going along this way (i.e. removing all runtime API apart from a necessary minimum)</div><div>will give a minor speed-up as compared to PEP 560 at the cost of a breaking change (even for small number of developers).</div></div></div></div></div></blockquote><div><br></div></span><div>I don't think the change will be breaking: usage of this class will be entirely voluntarily and does not replace typing.Generic</div><span class=""><br></span></div></div></blockquote><div><br></div><div>If you propose an additional class, then yes, it is non-breaking, but I still don't see much value given a minor performance improvement.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div>PEP 560 already gives overhead of 80% as compared to normal classes in worst case scenario</div><div>(empty body with a single generic base). This is actually less than for ABCs (they can give up to 120% in worst case scenario).<br></div></div></div></div></div></blockquote><div><br></div></span><div>GenericMeta inherits from ABCMeta. Do you mean that it will be removed after 560 lands?</div><span class=""><br></span></div></div></blockquote><div><br></div><div>Yes, GenericMeta will be removed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div>Moreover, performance is not a single motivation for PEP 560, there are other arguments such as metaclass conflicts which will</div><div>not be solved without the machinery proposed by the PEP.<br></div></div></div></div></div></blockquote><div><br></div></span><div>Perhaps you can consider designing Generic / GenericMeta in a way that will allow end user to create GenericStub-alike class without much trouble?</div></div></div></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">This can be done, but the hardest part here is not to make the runtime changes, but to get the support of all</div><div class="gmail_extra">static type checkers (they need to understand what GenericStub means and add all the necessary special casing).</div><div class="gmail_extra"><br></div><div class="gmail_extra">--</div><div class="gmail_extra">Ivan</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>