Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

For the datetime module there are also a few more subtle issues that would make 
it difficult to make a hybrid C/Python implementation.  The problem is that 
unlike the time module where most of the functionality is implemented in module 
level functions, datetime functionality is entirely in class methods.

One may suggest to use inheritance and derive datetime classes from those 
implemented in _datetime.c, but this will not work because for example datetime 
+ timedelta will return a _datetime class unless __add__ is overridden in 
Python.  There is another even less obvious issue with inheriting from datetime 
classes: see issue #5516.

Therefore, it looks like there are only two choices:

1. Replicate all functionality in both _datetime.c and datetime.py and thus 
double the cost of implementing new features in CPython. (OK, maybe not double 
because Python development is easier than C, but increase instead of decrease.)

2. Incur a performance penalty in every method because every C call wil have to 
be wrapped in Python.

Another -1 from me.

----------

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

Reply via email to