On 5/14/08, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Lisandro Dalcin wrote:
>
>  > So, should Cython save (in the Py3 case)
>  > byte strings in their internal table?
>
>
> There are two separate things going on here:
>
>  1) The reason for keeping string literals in a table is so
>  that you don't have to create a new string object every
>  time they're used. This would seem to apply to bytes just
>  as much as strings.
>
>  2) Interning of strings that are likely to be used in
>  dynamic name lookups. Since all names are strings, this
>  only applies to strings, not bytes.
>
>
>  > At this point, I'm not sure if meging the string tables was a good
>  > idea.
>
>
> I don't even see how you *can* merge them, since strings
>  and bytes are completely different types in py3k.

Indeed, I agree with you. Then, tell me your opinion about this (in
the Py3 case):

- Indentifiers and (unicode) string literals can (and should) managed
in the same table. This way, 'a.foo' will be as efficient as
'getattr(a, "foo")'

- Byte strings are completelly different guys, so they should be
managed in a way similar to integer literals are.





-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to