fake-bpy-module icon indicating copy to clipboard operation
fake-bpy-module copied to clipboard

Potential redundancy in doc-strings.

Open yunkezengren opened this issue 4 months ago • 4 comments

Hi, thanks for the great type stubs!

I have a quick question about potential redundancy. I see many properties defined like width: float which also have a :type: float tag in their docstring. This causes the type to appear twice in hover tooltips.

Is the :type: tag in the docstring still needed, or is it redundant now? Thanks.

Screenshots from VS Code below:

Image

Image

yunkezengren avatar Aug 11 '25 09:08 yunkezengren

So it's more of a redundancy in doc-strings than type hints.

Agreed, :type: in doc-strings seems redundant and removing it from everywhere might make stub-files a bit smaller (though it probably wouldn't affect perfomance, since file complexity would stay the same). Same goes for :rtype:.

E.g. currently bpy.types stub is 5.6MB, but with all :type: and :rtype: removed it becomes 5.2MB (248k loc -> 236k loc).

Andrej730 avatar Aug 11 '25 14:08 Andrej730

Thanks, yes. My title was unclear.

yunkezengren avatar Aug 12 '25 00:08 yunkezengren

Thank you for starting this discussion. This :type: is introduced due to the PyCharm support in the past. But it is not required for now. https://www.jetbrains.com/help/pycharm/type-hinting-in-product.html

So, I will remove :type: field for future release. Do you have any suggestion? @Andrej730 @yunkezengren

nutti avatar Oct 26 '25 10:10 nutti

Makes sense to me - at this point type information is just duplicated and can be safely removed.

Andrej730 avatar Oct 26 '25 14:10 Andrej730