Here's a better idea: Use parens for all the levels of nesting, as currently, but convince your editor to substitute various other bracket-ish things for levels of nesting.

I haven't done that, but I use the conceal plugin with vim to do similar things.  Up to some fixed finite levels of nesting, regex would do that.

On Mon, Jan 17, 2022 at 3:20 PM John Sturdy <jcg.sturdy@gmail.com> wrote:
Perhaps the time isn't ripe for this, and perhaps it never will be, but UTF8 seems to be handled by just about everything these days.  I suspect this is a crazy suggestion, but on the other hand perhaps people looking back from 2100 will think "It was crazy that they stuck exclusively with ASCII syntax characters for so long after Unicode was widely available".

Sometimes when you have quite a few levels of brackets, and there are more than one of the same type, might it be better to allow variants of each type of bracket character?  Unicode provides bold, double, small, superscript, subscript, and white-filled (hollow) variants of round, square and curly brackets, and top and bottom ticked variants of square brackets.

Perhaps not enough platforms will be able to display them? And entering them may be fiddly, although programmable editors and IDEs could let you type the standard characters but pick variants on a round-robin basis within each expression.

But it might be handled better in the display in editors and IDEs (perhaps syntax coloring brackets by their depth).  Or some might say not to write such deeply nested bracketed expressions.

Implementation parsers could simply translate all the brackets to the base types, or they could treat them as equivalent but distinct, and check that the open and close brackets match, which might catch a few errors.

There are also other quote characters available, such as the guillemets traditionally used in French.  There's absolutely no need to use such things, but for people working on code which will be used internally in, say, French or Quebecois organizations might welcome it.

OK, shoot this one down now :-)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/NIJX6QQPTCRZNGZH2FY77LEFGUW2A7JL/
Code of Conduct: http://python.org/psf/codeofconduct/


--
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.