On Mon, 24 Aug 2020 at 09:59, Alex Hall <alex.moj...@gmail.com> wrote:
>
> On Mon, Aug 24, 2020 at 9:54 AM Random832 <random...@fastmail.com> wrote:
>>
>> On Mon, Aug 24, 2020, at 00:43, Christopher Barker wrote:
>> > But thus brings up a broader question:
>> >
>> > Why not allow slice syntax as an expression everywhere? Everywhere I’ve
>> > tried, it’s a syntax error now, but is there any technical reason that
>> > it couldn’t be used pretty much anywhere?
>>
>> is {a:b} a set containing a slice, or a dict? obviously it's a dict, but are 
>> there any other places that might be affected? what about other forms of 
>> slices, or if it's not the only element? should we support {a, b:c} as a set 
>> containing a slice? what about {a:b, c}?
>>
>> there may be other places it might be desirable to add new syntax that uses 
>> the colon character, allowing slices anywhere would foreclose that.
>
>
> {a:b} is a dict, {(a:b)} is a set containing one slice.

Isn't the "broader question" actually "what is the justification for
allowing slice syntax as an expression everywhere?" In other words,
what are the use cases?

"Why not do X" is *never* a sufficient reason for a language change -
there is always a cost, and unless there's a corresponding benefit, it
simply isn't going to happen.

Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4564JBR6TQPASXYKDYCXYCT3TOLFNYIJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to