[Python-ideas] Re: Typescript-Like Notational Shortcuts

2022-07-01 Thread Abdulla Al Kathiri
I talked about this before but I have slightly different suggestions list[type] becomes [type] tuple[type1, type2, type3] becomes (type1, type2, type3) dict[type1, type2] becomes {type1: type2} set[type] becomes {type} Callable[[type1], type2] becomes (type1) -> type2 class MyTypedDict(Typed

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread Thomas Grainger
The generic collections in typing were deprecated in favor of the generic collections in collections.abc. The objects and the types were exposed to user code, and in the future they will not be > We don't want there to be warnings about them > forever The new wanrings._deprecated https://discuss

[Python-ideas] Re: dataclass field argument to allow converting value on init

2022-07-01 Thread Dexter Hill
Steve Jorgensen wrote: > Would we want something more general that could deal with cases where the > input does not have a 1-to-1 mapping to the field that differ only, perhaps, > in type hint? What if we want 1 argument to initializes 2 properties or vice > verse, etc.? That's definitely an imp

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread Jelle Zijlstra
El jue, 30 jun 2022 a las 22:19, Stephen J. Turnbull (< stephenjturnb...@gmail.com>) escribió: > nveric...@gmail.com writes: > > > I accidentally created another thread in python-dev as I mentioned > > above, but ideally Optional and Union should both be deprecated and > > phased out for the ne

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread nverich07
> BTW, I disagree with your arguments that Optional and Union are > misleading names that can be easily misunderstood, especially in the > usual context of formal arguments in function definitions. The comment made by Jelle Zijlstra suggested to me suggested that the new syntax might have been a

[Python-ideas] Re: dataclass field argument to allow converting value on init

2022-07-01 Thread Steve Jorgensen
Dexter Hill wrote: > Steve Jorgensen wrote: > > Would we want something more general that could deal with cases where the > > input does not have a 1-to-1 mapping to the field that differ only, > > perhaps, in type hint? What if we want 1 argument to initializes 2 > > properties or vice verse, e