[Python-Dev] Error in PEP3118?

Robert Kern robert.kern at gmail.com
Wed Jan 23 20:32:50 CET 2008


Thomas Heller wrote:

> Here is another typo (?) in the pep; I think it should be changed:
> 
> Index: pep-3118.txt
> ===================================================================
> --- pep-3118.txt	(revision 60037)
> +++ pep-3118.txt	(working copy)
> @@ -338,7 +338,7 @@
>  
>  ``len``
>      the total bytes of memory the object uses.  This should be the
> -    same as the product of the shape array multiplied by the number of
> +    same as the length of the shape array multiplied by the number of
>      bytes per item of memory.
>  
>  ``readonly``

While the original could be reworded ("product of the elements of the shape 
array"), the amendment is incorrect. For a shape array like {4*5*6}, the number 
of bytes is (4*5*6)*bytes_per_item, not 3*bytes_per_item.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco



More information about the Python-Dev mailing list