<div dir="ltr">Thanks Tony,<div><br></div><div>This is probably my ignorance of C# but I get the following error using the same syntax as the example:</div><div><br></div><div><div>The type or namespace name 'DocStringAttribute' could not be found (are you missing a using directive or an assembly reference?)</div>
</div><div><br></div><div>I have the:</div><div>using Python.Runtime</div><div>statement.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 7, 2014 at 12:19 PM, Tony Roberts <span dir="ltr"><<a href="mailto:tony@pyxll.com" target="_blank">tony@pyxll.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>if your class has a constructor then the class docstring will get replaced with a description of the constructor, even if you explicitly gave the class a docstring using DocStringAttribute.</div>

<div><br></div><div>I've created an issue for github for this and fixed it: <a href="https://github.com/pythonnet/pythonnet/issues/14" target="_blank">https://github.com/pythonnet/pythonnet/issues/14</a></div><div><br>
</div>In the same commit I added some unit tests which should do as an example for you to see how it should work (see the newly added file pythonnet/src/testing/doctest.cs and pythonnet/src/tests/test_docstring.py).<div>
<br></div><div>cheers,</div><div>Tony</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Mar 5, 2014 at 3:59 PM, Jonno <span dir="ltr"><<a href="mailto:jonnojohnson@gmail.com" target="_blank">jonnojohnson@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br></div><div>Is there an example how to format documentation in classes & methods so that a python docstring will be produced?</div>

<div><br></div><div>I found the following in a thread a while back but it's not working for me:</div>
<div><br></div><div><pre style="margin-top:0px;padding:0px;border:0px;outline:0px;font-size:12px;vertical-align:baseline;white-space:pre-wrap;word-wrap:break-word;color:rgb(51,51,51);line-height:19.600000381469727px">### test.cs ##
using System;
using System.Runtime.InteropServices;
using Python.Runtime;

namespace PinvokeTest
{
        [DocStringAttribute("Interface class to external functions.")]
        public class Invoke {
                
                [DocStringAttribute("External funtion simulation: WriteToFile(char) 
will write a char to the terminal.")]
                public static void WriteToFile(char arg) {
                        Console.WriteLine("Writing {0}", arg);
                         return;
                }
        }
}</pre></div></div>
<br></div></div>_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><br></blockquote></div><br></div>
<br>_________________________________________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org">PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">https://mail.python.org/mailman/listinfo/pythondotnet</a><br></blockquote></div><br></div>