How to fix those errors?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Nov 17 01:38:31 CET 2014


Chris Angelico wrote:

> You should be able to use two semicolons, that's equivalent to one colon
> right?
> 
> ChrisA
> (No, it isn't, so don't take this advice. Thanks.)


Oooh! Python-ideas territory! 

I think the parser should allow two consecutive semi-colons, or four commas,
as an alias for a colon. Then we could write code like:


def spam(arg);;
    for x in seq,,,,
        pass


for people who have a broken keyboard or have remapped colon to something
else. It would also make reading slices an exciting adventure:

    seq[1,,,,][,,,,,,,,-1]


What do you think? Is it perhaps better suited to perl-ideas?


Feeling-whimsical-at-the-moment-ly y'rs,


-- 
Steven




More information about the Python-list mailing list