Closed phobos2077 closed 4 months ago
Would also be nice to parse and display comment after @ret
I don't like duplication. But I also don't like mixing info from different sources. I think it can get too complicated for too little gain. Need to think about it. Maybe make an exception for default values, but I definitely don't want to merge argument lists. Although trusting just one source seems more reliable still.
For functions with return values, the description of those is usually the first thing in the body of the docstring. So, not sure if that's any benefit.
But I also don't like mixing info from different sources. I think it can get too complicated for too little gain.
Simple idea: if there's not a single @arg
in comment, then you just take data from code (and put any as type). Otherwise trust the @args
. This should fix the common case where you just want to put some description without writing out every arg.
For functions with return values, the description of those is usually the first thing in the body of the docstring. So, not sure if that's any benefit.
It's just a simple readability improvement - you see return value described after arguments, like it usually is in documentation.
It's just a simple readability improvement - you see return value described after arguments, like it usually is in documentation.
Usually... where? Because this is what I usually see
For args, I think default form will do
If there's nothing to add about ret, I guess that'll be all.
If there's nothing to add about ret, I guess that'll be all.
I mean, it would still be useful to be able to describe return value. But it's not as critical.
I showed how it's usually described in my experience. If your experience differs, feel free to share.
If your experience differs, feel free to share.
Well I come from C# background. There comments have a structure with return value having it's own tag that describes what is returned separately.
As I said, it's not very important, but a feature you would expect when writing structured comments. Why args have comment but ret does not? Feels inconsistent.
Screenshot
What's wrong on screenshot
Code