(answering the question below, sorry about top-post (on cellphone)):
You do something like this:
classname = None
def visit_ClassDefNode(self, node):
oldname = self.classname
self.classname = node.X # name?
# or perhaps node.entry.name
self.visitchildren(node)
self.classname = oldname
def visit_FuncDefNode(self, node):
....
use self.classname
....
Dag Sverre Seljebotn
-----Original Message-----
From: "Lisandro Dalcin" <[EMAIL PROTECTED]>
Date: Monday, Sep 8, 2008 7:02 pm
Subject: Re: [Cython] transform efficiency
To: [EMAIL PROTECTED]: [email protected]
On Mon, Sep 8, 2008 at 1:46 PM, Dag Sverre Seljebotn
><[EMAIL PROTECTED]> wrote:
>>>
>> Lisandro simply shouldn't call self.visitchildren in visit_FuncDefNode,
>> no new transform type is needed.
>>
>
>OK, I'm not visiting children. However, what should I do if I want to
>'push/pop' the class name where a method is defined?
>
>
>>
>> For my own uses, gcc still uses *a lot* more running-time than Cython,
>> so I don't have an itch to scratch here -- how are things in SAGE?
>
>That's the situation for me, too. As a side note, I never experienced
>any speed-up from using a compiled 'Scanners.so' in my projects.
>
>
>
>--
>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
>
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev