Potential redundancy in doc-strings.
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:
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).
Thanks, yes. My title was unclear.
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
Makes sense to me - at this point type information is just duplicated and can be safely removed.