<div dir="ltr">On 15 December 2017 at 15:55, Yury Selivanov <span dir="ltr"><<a href="mailto:yselivanov.ml@gmail.com" target="_blank">yselivanov.ml@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> I don't see any problems with implementing this on types defined in C. This isn't harder than implementing __sizeof__ or pickling support, and NumPy classes already have implemented both. Maybe Yury forgot about METH_STATIC and METH_CLASS?<br>
<br>
</span>I just tested __class_getitem__ defined via METH_STATIC and it works.<br>
This means we don't need to add slots.  Thanks for the hint, Serhiy!<br>
<br>
Ivan, this might be worth mentioning in the PEP or in the docs.</blockquote><div><br></div><div>I think it should be added to the PEP. Somehow I didn't think about C extensions, but now I see that it is important, also recently there appeared a lot of interest in better support of static typing for NumPy arrays and numeric stack.</div><div>I will make a PR a bit later.<br></div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></div></div></div>