[Python-ideas] Re: SimpleNamespace vs object

2021-02-19 Thread Dan Strokirk
> If SimpleNamespace were to become a builtin, what should its name be? Just to have the obvious out of the way: * obj() - fits with most other builtins in that they are abbreviations and 3-4 letters * data() - same, might be confused with dataclass * container() * values() Most of these are lik

[Python-ideas] Re: Alternate lambda syntax

2021-02-19 Thread Stephen J. Turnbull
Abdulla Al Kathiri writes: Condensing to the parts which are in question, > def test(self, func: t.Callable[..., bool], *args, **kwargs) -> Predicate: > return self._build_predicate( >lambda lhs, value: func(lhs, *args, **kwargs), > Operation.TEST, >

[Python-ideas] Re: Alternate lambda syntax

2021-02-19 Thread Paul Sokolovsky
Hello, On Sat, 20 Feb 2021 00:23:13 +0900 "Stephen J. Turnbull" wrote: > Abdulla Al Kathiri writes: > > Condensing to the parts which are in question, > > > def test(self, func: t.Callable[..., bool], *args, **kwargs) -> > > Predicate: return self._build_predicate( > >lamb

[Python-ideas] Syntax for duplicate types in seq[...]

2021-02-19 Thread wyz23x2
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

[Python-ideas] Re: Syntax for duplicate types in seq[...]

2021-02-19 Thread Dennis Sweeney
Does this work? >>> tuple[(int,) * 7 + (str,)] tuple[int, int, int, int, int, int, int, str] ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/l