(original) (raw)

A slot is pretty expensive, as \*every\* class in existence will be another 8 bytes larger (and possibly more due to malloc rounding). So unless we find that there's a significant performance benefit I think we should hold back on this. IIRC Ivan has already measured an order of magnitude's speedup (well, 7x), so we may not need it. :-)

On Thu, Dec 14, 2017 at 3:49 PM, Yury Selivanov <yselivanov.ml@gmail.com> wrote:
Ivan, Guido,

Would it be possible to add a slot so that types defined in C can
implement \_\_class\_getitem\_\_?

static PyClassMethodDef class\_methods = {
foo\_class\_getitem /\* cm\_class\_getitem \*/
}

static PyTypeObject Foo = {
.tp\_class\_methods = class\_methods
}

Yury

On Mon, Dec 4, 2017 at 5:18 PM, Ivan Levkivskyi <levkivskyi@gmail.com> wrote:
\> Thank you! It looks like we have a bunch of accepted PEPs today.
\> It is great to see all this! Thanks everyone who participated in discussions
\> here, on python-ideas and
\> on typing tracker. Special thanks to Mark who started this discussion.
\>
\> --
\> Ivan
\>
\>
\>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> Python-Dev mailing list
\> Python-Dev@python.org
\> https://mail.python.org/mailman/listinfo/python-dev
\> Unsubscribe:
\> https://mail.python.org/mailman/options/python-dev/yselivanov.ml%40gmail.com
\>



--
--Guido van Rossum (python.org/\~guido)