Syntax for duplicate types in seq[...]

Imagine specifying multiple same types. Awful. ``` from typing import Tuple def time() -> Tuple[int, int, int, int, int, int, int, str]: """ Return (year, month, day, hour, minute, second, millisecond, timezone name). ... ``` So I suggest a new syntax, ``Seq[type * times]``, to solve this problem: ``` from typing import Tuple def time() -> Tuple[int * 7, str]: ... ```

Does this work? >>> tuple[(int,) * 7 + (str,)] tuple[int, int, int, int, int, int, int, str]

On Fri, Feb 19, 2021 at 9:17 PM Dennis Sweeney <sweeney.dennis650@gmail.com> wrote:
Even better: TImeTuple = tuple[(int,) * 7 + (str,)] and then: def time() ->TimeTuple ... -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

Does this work? >>> tuple[(int,) * 7 + (str,)] tuple[int, int, int, int, int, int, int, str]

On Fri, Feb 19, 2021 at 9:17 PM Dennis Sweeney <sweeney.dennis650@gmail.com> wrote:
Even better: TImeTuple = tuple[(int,) * 7 + (str,)] and then: def time() ->TimeTuple ... -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
participants (3)
-
Christopher Barker
-
Dennis Sweeney
-
wyz23x2@163.com