[Python-Dev] (no subject) (original) (raw)

Victor Stinner victor.stinner at gmail.com
Tue Feb 10 09:11:22 CET 2015


Le 10 févr. 2015 06:48, "Greg Ewing" <greg.ewing at canterbury.ac.nz> a écrit :

It could potentially be a little more efficient by eliminating the construction of an intermediate list.

Is it the case in the implementation? If it has to create a temporary list/tuple, I will prefer to not use it.

After long years of development, I chose to limit myself to one instruction per line. It is for different reason:

So I now prefer more verbise code even it is longer to write and may look less efficient.

Same again, multiple ** avoids construction of an itermediate dict.

Again, is it the case in the implementation. It may be possible to modify CPython to really avoid a temporary dict (at least for some kind of Python functions), but it would a large refactoring.

Usually, if an operation is not efficient, it's not implement, so users don't try to use it and may even try to write their code differently (to avoid the performance issue).

(But slow operations exist like list.remove.)

Victor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150210/5d352489/attachment.html>



More information about the Python-Dev mailing list