[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Brandt Bucher
Just to be clear, PEP 584 (dictionary operators) is currently in draft form and is undergoing a new round of revisions. Nothing has been finalized, much less approved. Brandt ___ Python-ideas mailing list -- [email protected] To unsubscribe send

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Steven D'Aprano
On Thu, Sep 05, 2019 at 05:41:50PM -0700, Andrew Barnert wrote: > Are runtime union types actually types, unlike the things in typing, > or are they still non-type values that just have special handling as > the second argument of isinstance and issubclass and maybe except > statements? Union

[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Rich Smith
On Thu, 5 Sep 2019 at 16:51, Andrew Barnert wrote: > > You say here “the dict insertion code” does it. Would they mean > d[key]=d.skip doesn’t insert anything? Yes. If so, then how could I put skip in a dict at all? The intention is that you couldn't. This could raise some implementation iss

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Andrew Barnert via Python-ideas
On Friday, September 6, 2019, 1:51:35 AM PDT, Steven D'Aprano wrote: > On Thu, Sep 05, 2019 at 05:41:50PM -0700, Andrew Barnert wrote: >> Are runtime union types actually types, unlike the things in typing, >> or are they still non-type values that just have special handling as >> the secon

[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Andrew Barnert via Python-ideas
On Friday, September 6, 2019, 11:22:08 AM PDT, Rich Smith wrote: > On Thu, 5 Sep 2019 at 16:51, Andrew Barnert wrote: >> You say here “the dict insertion code” does it. Would they mean >> d[key]=d.skip doesn’t insert anything? > Yes. OK, then I go from +0 on your proposal to -1. Constructing d

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Steven D'Aprano
On Fri, Sep 06, 2019 at 07:44:19PM +, Andrew Barnert wrote: > > Union, and unions, are currently types: > > > py> isinstance(Union, type) > > True > >  > > py> isinstance(Union[int, str], type) > > True > > What version of Python are you using here? Ah, I didn't realise that the behaviour h

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Andrew Barnert via Python-ideas
On Friday, September 6, 2019, 5:41:23 PM PDT, Steven D'Aprano wrote: >On Fri, Sep 06, 2019 at 07:44:19PM +, Andrew Barnert wrote: >> > Union, and unions, are currently types: >> >> > py> isinstance(Union, type) >> > True >> >  >> > py> isinstance(Union[int, str], type) >> > True >> >>

[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Joao S. O. Bueno
On Fri, 6 Sep 2019 at 01:54, Guido van Rossum wrote: > On Thu, Sep 5, 2019 at 8:37 PM Joao S. O. Bueno > wrote: > >> Also, if one have in mind that dict addition with the `+` operator had >> been >> recelently approved >> > > Where did you hear this? I am not aware that this was even made into a

[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Steven D'Aprano
On Sat, Sep 07, 2019 at 12:35:09AM -0300, Joao S. O. Bueno wrote: > Well - the idea showed up here, and got an immediate "that is nice, let's > do it" from you, followed by approval from a lot more people, and > very little controverse. So, it is pretty much "approved", even if not yet > detailed