Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

1. This will increase the size of type object. Most types are not numbers, not 
collections and don't support the buffer protocol, thus save memory for 
tp_as_number, tp_as_sequence, tp_as_mapping and tp_as_buffer. This also can 
increase the time of type creation.

2. This will make harder testing that the particular protocol is supported 
(e.g. see PyIndex_Check or PyObject_CheckBuffer). And this will break any 
third-party code that does this directly, without using C API.

3. Calling function instead of executing inlined code after checking can 
increase stack consumption and slow down execution (see the usage of 
tp_descr_get).

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31791>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to