ENH: Using type hints for scipy functions
See original GitHub issueI have an idea about using python type hints for scipy functions and creating new type hints instead of built-in types. for example:
from typing import NewType, Union
array_like = NewType("array_like", Union[ndarray, list])
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (12 by maintainers)
Top Results From Across the Web
PEP 484 – Type Hints - Python Enhancement Proposals
In its basic form, type hinting is used by filling function annotation slots with classes: def greeting(name: str) -> str: return 'Hello '...
Read more >applying type hint(PEP 484) for scipy · Issue #9038 - GitHub
Since PEP 484 was announced, type hint has been very helpful for a large-scale development to recognize variables in a variety of functions....
Read more >Writing Good Code - Python Like You Mean It
Type hinting is a syntax that was introduced in Python 3.5 (via PEP 484), which permits users to annotate their function definitions to...
Read more >Python Type Hinting. Beginner's Cheat Sheet | Depurr |
Basic Syntax Here, we use colon : to specify the type of input arguments, and arrow -> to specify the type of the...
Read more >Type hints cheat sheet - mypy 0.991 documentation
Type hints cheat sheet#. This document is a quick cheat sheet showing how to use type annotations for various common types in Python....
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
As an outsider, and having worked with types for most of my professional life, and having seen the effects of maintaining them in external repositories… I would say having them in the same repository is the most sensible approach.
It’s true that introducing types in a huge code base that does not have them is a huge effort, but this cost is payed only once, after that’s done, they are very easy to maintain, and they usually help to spot minor bugs related to corner cases handling.
@EverLookNeverSee generally speaking though I would be very interested in an effort to start getting type hints into SciPy.