On 5/16/08, Stefan Behnel <[EMAIL PROTECTED]> wrote: > The thing is that if you write > > getattr(o, u"attr") > > in Cython, it will work in both Py2 and Py3. However, > > getattr(o, "attr") > > will only work in Py2, unless you do the future import.
Stefan, I understood that one of the traget of Cython is to efficiently compile Python code. Please note that getattr(o, u"attr") is not valid Python 3 code at all !! You are proposing that if I do "def foo(): ..." the the identifier 'foo' will be implicitely treated as unicode for Py3, but a string literal "abc" do not !!. I realize that this can be just fixed with a future import, but it seems a really ugly to me. Future directives are just for that, for the future. In a Py3 runtime, we are at the present, so why Cython should rely on the future import for match the semantics of the present? -- 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
