Page 1 of 1

About comments on main.py source code

Posted: Wed Oct 21, 2015 10:50 am
by photoacoustic
Dear all,
I would like to know if there is some recommendation about comments in source file.
Can I put much as I like without losing memory?
Thanks in advance for your comments and suggestions
Best regargs

Re: About comments on main.py source code

Posted: Wed Oct 21, 2015 11:14 am
by Damien
Actual comments starting with a hash # are removed by the lexer and take no RAM. They only take space in the file itself. So you can write as many as you like.

Strings/doc-strings as comments do take some amount of RAM when compiling so better to avoid them.

Re: About comments on main.py source code

Posted: Wed Oct 21, 2015 12:52 pm
by photoacoustic
Thank for the response

Re: About comments on main.py source code

Posted: Wed Oct 21, 2015 3:46 pm
by kfricke
Interesting to know. Can you recommend some '#'-based comment style for the generation of documentation from code? I am thinking of some drivers which might need some love and could generate nice "Read the Docs" documentation. I hope that is reasonable!?

Re: RE: Re: About comments on main.py source code

Posted: Wed Oct 21, 2015 4:12 pm
by Damien
kfricke wrote: Can you recommend some '#'-based comment style for the generation of documentation from code?
I'd put restructured text in the comments. Easy to extract (just strip leading #) and then pass to sphinx.