Paul Sokolovsky added the comment:

> >>> array.array('i', [0]) * 3

@Serhiy Storchaka:

The keyword is "efficiently". Let's analyze: this creates useless 
array.array('i', [0]) object destined only for garbage collection. Then, it 
forces using loop of loops to fill in a new object. Whereas array.array('i', 3) 
immediately reduces to a memset().

You can say that these implementation efficiency issues are of little concert 
to CPython. But what's being reported here is that, while generally Python is 
pretty good in allowing to efficiently process raw binary data (memoryview and 
all other bits and pieces), there are inconsistent accidental gaps in API here 
and there which jeopardize  efficiency, in obvious way (and also obvious to 
resolve), what may be of concern for other Python implementations (my case).

----------

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

Reply via email to