Alexander Belopolsky added the comment:

I would like to split this issue to separate PEP 3121 changes from PEP 384.  
PEP 3121 state cleanup implementation is clearly an improvement "from a 
resource management point of view."  On the other hand, I don't see much 
benefit for the datetime module from using a stable ABI.  Unless I am missing 
something, PEP 384 is primarily benefiting 3rd party developers who distribute 
binary modules that should run under multiple Python versions.  ABI stability 
is not a concern for the stdlib modules.

On the other hand, the price for multi-version support is rather steep.  
Statically allocated types are more efficient.  For example, with static types, 
PyDate_CheckExact() is a simple macro that expands into a dereference and a 
pointer comparison - a couple of instructions at the CPU level.  On the other 
hand, with a proposed patch, it will involve a function call to locate the 
module (PyState_FindModule), followed by another function call to locate the 
state (PyModule_GetState) and several more dereferences that may lead to cache 
misses and other pessimizations.

There is an important behavior change related to multiple interpreters.  
Currently dates created by different interpreters have the same type.  With the 
proposed change they will have different types.  I don't think this is 
desirable.

In short, let's go in baby steps.  Let's implement PEP 3121 cleanup first and 
start a debate on the role of PEP 384 in stdlib.

----------
nosy: +loewis

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

Reply via email to