question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: Using type hints for scipy functions

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

5reactions
castarcocommented, Oct 21, 2021

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.

2reactions
person142commented, Mar 15, 2020

@EverLookNeverSee generally speaking though I would be very interested in an effort to start getting type hints into SciPy.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found