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.
_______________________________________________ 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/CD7JHBY6JYSE3S53HCND2TGGUF543DV2/ Code of Conduct: http://python.org/psf/codeofconduct/