On Fri, Aug 13, 2021 at 12:00 AM Ricky Teachey <[email protected]> wrote: > > On Thu, Aug 12, 2021 at 9:02 AM Calvin Spealman <[email protected]> wrote: >> >> An alternative suggestion, which works today (... is a valid object called >> Ellipsis): >> >> Foobar.search( >> attr1="foo", >> attr2=[10, ...], >> attr3=[42, ..., 50] >> ) > > > This got me thinking just now: allowing ellipses instead of None for the > first two arguments of the slice() constructor might be a neat idea. > > These looks pretty nice: > > slice(1, ...) > slice(1, ..., 2) > slice(-1, ..., -1) > slice(..., ..., 3) > > I wonder if-- had the ellipses existed when slice() was created eons ago/in > the depths of time-- whether ... would have been used rather than None for > these. > > I'm not really proposing this, just musing. >
Ellipsis has a different meaning. None means omitted, Ellipsis means something that most classes ignore (Numpy uses it for "all other dimensions"). ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/ROTC5Z4U2W6XPON7K4WIEZEAN3JCSYIZ/ Code of Conduct: http://python.org/psf/codeofconduct/
