Should there be a `Numeric` type?
Should there exist a Numeric type, as suggested by the data model? That is, one that affirms the existence of the methods described in that section.
Are you looking for numbers.Number https://docs.python.org/3/library/numbers.html?
Ah, presumably! Thanks.
There isn't a great solution for this right now, see https://github.com/python/mypy/issues/3186 for details.
Thanks. Seems like a long nuanced debate...
Thanks. Seems like a long nuanced debate...
It's certainly long, but in my observation, there appears to be no appetite or urgency to fix it (at least not by those in power). That may mean it's nuanced, but I get the sense that apathy plays a greater role. It just doesn't appear to be a priority for those who make the decisions, irrespective of how many of us plebes scar ourselves navigating the broken glass filled alleyways that weave between what is advertised and what is real.
The other way to interpret that is that this issue needs someone willing to spend the time to push it forward. Most of working on typing are volunteers, and we work on things that interest us. I'm personally not interested in spending a lot of time on this, but I'd be delighted if someone takes the initiative to figure out a way forward.
I'm not up on the latest, but (as you know) @ramalho hinted at some promising work, (possibly with @leorochael?). However, we might have to wait for his book release before we get to see that. Hopefully they can make forward progress where others have tried and failed or been cast aside.
FWIW, I pulled out a lot of my number typing work-arounds into their own package called numerary. If this journey lines up with others who land on this issue, numerary could be an intermediary solution until python/mypy#3186 is fixed. (Alternatively, the techniques used therein might provide inspiration where one can't take a dependency.) Happy to consult here, if helpful. (And looking forward to/fantasizing about getting schooled by @ramalho at some point!)