On Sep 18, 2008, at 12:56 AM, Dag Sverre Seljebotn wrote: > Dag Sverre Seljebotn wrote: >> Lisandro Dalcin wrote: >>> On Wed, Sep 17, 2008 at 4:54 PM, Dag Sverre Seljebotn >>> <[EMAIL PROTECTED]> wrote: >>> >>>> Lisandro wrote: >>>> >>>>> I've almost finished the transform in charge of embeding functions >>>>> signatures in docstrings. I want to ask your about some issues >>>>> I need >>>>> to handle to finish it. >>>>> >>>>> * Position in the transform pipeline: I'm curently inserting the >>>>> auto-signature transform after the 'ResolveOptions' one in the >>>>> transform pipeline. Dag, tell me if this is OK. >>>>> >>>> For this, anywhere where you have the needed information available >>>> is ok. >>>> I guess you read the type info from nodes then, and not the >>>> "parsed" >>>> info >>>> that is available later? (that could make sense and is not >>>> necesarrily a >>>> bad sign) >>>> >>>> >>> >>> I did not understand you here, but anyway it seems to work at the >>> place I'm inserting it. Or perhaps I could get more info (like >>> return >>> type in 'cpdef' funcions) if I insert the transform near the end? >>> >> Sorry, my fault. Basically, when I wrote my description I meant to >> imply (and should have clarified better) that the >> AnalyseDeclarationsTransform interprets the nodes containing the type >> declarations into a purer Python representation (see PyrexTypes.py). >> However for what you are doing, walking the CSimpleTypeNodes might be >> just as good. >> >> (Inserting the transform after AnalyseDeclarationsTransform makes >> certain things > (I need a countdown timer on my send button...) > > I meant to say: Inserting the transform after > AnalyseDeclarationsTransform makes certain things more difficult -- > because for cpdef functions, a "python version node" is created and > the > docstring copied so you would need to change it in multiple locations > and so on. So actually, what you have done will be more convenient and > make this more isolated and less likely to break if the cpdef > implementation is changed.
I went ahead and moved it to after AnalyseDeclarationsTransform because it wasn't picking up some of the types correctly after some other changes I made (specifically, the parser no longer keeps track of a list of all types seen, but this means it may mistake a argument name for a type name in a function declaration, which is corrected later). Setting the signature is a little less elegant, but it does make some of the other code quite a bit cleaner. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
