[Python-Dev] adding a bytes sequence type to Python

Guido van Rossum guido at python.org
Thu Aug 12 22:56:07 CEST 2004


> Wouldn't the compiler be able to tell it was to be treated specially if it
> saw b"GET"?  In that case, the code generated for
> 
>     x = b"GET"
> 
> would be something like
> 
>     LOAD_CONST     "GET"
>     LOAD_NAME      bytes
>     CALL_FUNCTION  1
>     STORE_FAST     x

This is actually an illustration of what I meant: a performance-aware
person might want to move that CALL_FUNCTION out of an inner loop if
they knew the result was never modified inside the loop.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list