Assigning generator expressions to ctype arrays
Terry Reedy
tjreedy at udel.edu
Fri Oct 28 04:19:26 EDT 2011
On 10/28/2011 3:21 AM, Steven D'Aprano wrote:
> If the slice has too few elements, you've just blown away the entire
> iterator for no good reason.
> If the slice is the right length, but the iterator doesn't next raise
> StopIteration, you've just thrown away one perfectly good value. Hope it
> wasn't something important.
You have also over-written values that should be set back to what they
were, before the exception is raised, which is why I said the test needs
to be done with a temporary array.
--
Terry Jan Reedy
More information about the Python-list
mailing list