ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
20.11k stars 1.49k forks source link

Convert typehints within docstrings to proper in-code typings #2121

Open Darylgolden opened 2 years ago

Darylgolden commented 2 years ago

Enhancement proposal

Currently, there are many instances of type hints being provided within docstrings - at Paragraph, for example. This has the disadvantage of not being able to be read by IDEs. Since we've standardized all new PRs to use in-code typings since a while back, the old ones should also be changed. A good example of properly implemented typings can be found here, for instance.

This is far too broad an issue to be resolved by a single PR, so I recommend fixing around one file per PR.

Additional comments

monalisha31 commented 2 years ago

@Darylgolden I would like to work on this issue.

Darylgolden commented 2 years ago

@Darylgolden I would like to work on this issue.

Go ahead!

dhgoratela commented 2 years ago

Hi @Darylgolden Can I get a list of all the files which have to be changed?

dhgoratela commented 2 years ago

I would like to work on this issue

Darylgolden commented 2 years ago

I would like to work on this issue

Hi @dhgoratela, unfortunately we don't have such a list. You can probably find many instances just looking through the files.

Davidy22 commented 2 years ago

Did a quick run through of mypy --follow-imports=skip, output here. Maybe mypy missed some stuff, but probably this is the full list of stuff that needs typing done.

dhgoratela commented 2 years ago

Le me do that. Thanks @Davidy22 for the info!

Davidy22 commented 2 years ago

Also I feel like this issue sort of overlaps with #52. If we're using tools to find files to fix up for #52, they'll catch the files that only have docstring types anyways.

dhgoratela commented 2 years ago

Okay shall check that for more understanding

madt2709 commented 1 year ago

I think this issue can be closed right?

NotWearingPants commented 10 months ago

I think this issue can be closed right?

All the parameters are gone, but there are still return types and attribute types in docstrings.

The problem with return types is that the documentation doesn't seem to pick up on the return type hint, so I don't want to convert everything at the cost of ruining the docs.

The attribute types are doable I think.