Hello, currently I write a class with api like
a[{(1,2): 3, (4,7): 7}]
its signature is dict[tuple[int, int], int]
and I find I can pass directly without {}
like
a[(1, 2): 3, (4, 7): 7]
then its signature becomes tuple[slice]
.
I don’t know whether it is good choice
but I find i cannot specify the type in slice
that is to say I cannot write tuple[slice[tuple[int, int], int, NoneType]]
maybe slice should not accept none integer argument?
In short, I think python should do one of two following things:
- forbid none integer argument for slice
- add slice support for generic alias just like list or dict, then I can write something like
slice[int, int, int]