Title: Add new type in typing
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: ThatXliner, gvanrossum, levkivskyi
Priority: normal Keywords:

Created on 2020-10-12 15:41 by ThatXliner, last changed 2020-10-12 20:43 by gvanrossum. This issue is now closed.

Messages (2)
msg378505 - (view) Author: ThatXliner (ThatXliner) Date: 2020-10-12 15:41
Because there is a typing.AnyStr (which is equal to AnyStr = TypeVar("AnyStr", str, bytes)), I think there should be a AnyNum which is equivalent to

from decimal import Decimal
from fractions import Fraction
AnyNum = TypeVar("AnyNum", int, float, complex, Decimal, Fraction)
msg378523 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-10-12 20:43
You can easily define that yourself if you need it, though honestly the utility seems marginal.
Date User Action Args
2020-10-12 20:43:03gvanrossumsetstatus: open -> closed
resolution: rejected
messages: + msg378523

stage: resolved
2020-10-12 18:40:51rhettingersetnosy: + gvanrossum, levkivskyi
2020-10-12 16:46:55ThatXlinersetversions: + Python 3.10
2020-10-12 16:46:44ThatXlinersetversions: + Python 3.9, - Python 3.10
2020-10-12 15:41:05ThatXlinercreate