On 18/08/20 6:00 am, Christopher Barker wrote:
But from a language design perspective, the [] operator is a way to "index" a container -- get part of the container's contents. And from this perspective, no index makes no sense.

It can make sense if you have a zero-dimensional array. Or as much
sense as zero-dimensional arrays make in the first place.

Although, as has been pointed out, there is some ambiguity as to
whether a[] should mean the scalar inside the zero-dimensional
array or a view of the array, so maybe the refusal-to-guess
principle argues that it should be disallowed.

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

Reply via email to