Add typings
See original GitHub issueWe should add typings to manim:
- It allows for more precise intellisense and easier-to-check code (via
mypyand whatnot); - It ensures we follow a structure that makes sense (i.e., ensures we don’t have a data model in which people get completely lost);
- Writing documentation and specifying types are tied to each other. When we work on documentation, it is inevitable that we will specify types for things, so why not add it to the code as well?
Notes:
- We can use
stubgento have a headstart; - We can use stub files in order to keep typings separate from the code and not have to change things much (but this is debatable - please expose your opinions on this);
- This is very related to the dataclasses solution proposed in #7, and may ultimately be a consequence of it.
Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:23 (22 by maintainers)
Top Results From Across the Web
How to add custom "typings" in typescript 2.0 / 3.0
You can create local custom typings just for your project, where you can declare types for JS libraries. For that, you need to:....
Read more >How to add custom types into the TypeScript project - drag13.io
Tutorial how to add custom types (typings) for the third-party code into the TypeScript project or how to solve "could not find a...
Read more >TypeScript: Adding Custom Type Definitions for Existing ...
In these circumstances, you have to add your own custom type definitions for the libraries. This article will show you how to that....
Read more >Typescript Typings: The Complete Guide: @types Compiler ...
Typescript Typings - The Complete Guide To Type Definitions: @types, ... With ts-node installed, let's add a npm script task to run our...
Read more >Adding Custom Type Definitions to a Third-Party Library
Add an index.d.ts file with your typings into that folder: types/third-party-library-name/index.d.ts. 5. Add your type definition.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

got it
if we can configure that, then it should be fine The only thing that we have to note is that, at the moment, we aren’t adding typehints in code, so they must be added in docstring for now Then a future typings PR may move them from the docstring to the code, and we may have simpler docstring types.
It’s work in progress. Type hints have been added to some parts of the library; help for adding them to other parts is warmly welcome.