[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

Serhiy Storchaka report at bugs.python.org
Mon Mar 4 17:34:15 CET 2013


Serhiy Storchaka added the comment:

This unlikely will be useful. C code uses __length_hint__ because C code is fast enough and fill time can be comparable to resize time. But Python code will be one or two order slower and resize time is insignificant fraction of total time for any real code. You can implement your proposition and do the tests, and I doubt that they will show impressive results.

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

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17338>
_______________________________________


More information about the Python-bugs-list mailing list