typing icon indicating copy to clipboard operation
typing copied to clipboard

Should there be a `Numeric` type?

Open alexreg opened this issue 4 years ago • 8 comments

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.

alexreg avatar Sep 24 '21 16:09 alexreg

Are you looking for numbers.Number https://docs.python.org/3/library/numbers.html?

Gobot1234 avatar Sep 24 '21 16:09 Gobot1234

Ah, presumably! Thanks.

alexreg avatar Sep 24 '21 17:09 alexreg

There isn't a great solution for this right now, see https://github.com/python/mypy/issues/3186 for details.

hauntsaninja avatar Sep 24 '21 19:09 hauntsaninja

Thanks. Seems like a long nuanced debate...

alexreg avatar Sep 24 '21 21:09 alexreg

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.

posita avatar Oct 02 '21 21:10 posita

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.

JelleZijlstra avatar Oct 02 '21 21:10 JelleZijlstra

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.

posita avatar Oct 02 '21 23:10 posita

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!)

posita avatar Dec 15 '21 23:12 posita