A
Avi Kak
Hello:
Is it possible in Python to define an empty list
of a predetermined size?
To illustrate my question further, I can do the
following in Perl
my @arr = ();
$#arr = 999;
that wold cause @arr to become an empty array
of size 1000. This array could be used to
store 1000 elements without any further memory
allocation for the array itself.
Can the same be done in Python?
Avi Kak
(e-mail address removed)
Is it possible in Python to define an empty list
of a predetermined size?
To illustrate my question further, I can do the
following in Perl
my @arr = ();
$#arr = 999;
that wold cause @arr to become an empty array
of size 1000. This array could be used to
store 1000 elements without any further memory
allocation for the array itself.
Can the same be done in Python?
Avi Kak
(e-mail address removed)