[Ironpython-users] Retrieving comments from FunctionDefinition nodes in c#
Stéphane Lozier
stephane.lozier at gmail.com
Thu May 4 16:42:32 EDT 2017
I believe the documentation is part of the body of the function. Maybe try
node.Body.Documentation?
Stéphane
On Tue, May 2, 2017 at 8:08 AM, Venkatesh Potluri <venky.92 at gmail.com>
wrote:
> Hi list,
>
> I am unable to extract comments corresponding to a python function
> using IronPython in c#. Despite the python code corresponding to the
> FunctionDefinition node having comments, the FunctionDefinition
> node.documentation seems to be empty.
>
> What exactly am I missing?
> I am attaching my c# function override for Bool
> walk(FunctionDefinition node) and the python code I use for testing.
>
> // C# code:
> class MyWalker:PythonWalker {
> public override bool Walk(ClassDefinition node)
> {
> Trace.TraceInformation(node.Documentation);
> return True;
> }
> }
>
> ###Python Code that this is tested against:
> def printHello():
> """This is a test DocString comment."""
> return 'hello'
>
>
> I do not get any output. the string is empty.
>
> Thank you and best regards,
> Venkatesh
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> https://mail.python.org/mailman/listinfo/ironpython-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20170504/fe55c4a0/attachment.html>
More information about the Ironpython-users
mailing list