Closed
Description
Problem:
Almost all of the settable properties (such as Body.mass
) are dynamically defined, so mypy doesn't recognize them. The properties get inferred to be of type Any
(from the mixin), which is undesirable.
Suggestion:
Rewrite most of the writable properties in normal syntax, putting their docstring in the getter function. Static type checkers can then correctly see their type.
I can make the PR.
Exception:
Some properties are of Vec2d
and so their setter accepts tuples, a different type than the getter. It has been pointed out before that type checkers don't recognize this.
So, these properties will be left alone.
Note: Mypy 1.16 adds support for getters and setters with different types. See the release notes.
Metadata
Metadata
Assignees
Labels
No labels