[Python-3000] PEP 3125 -- a modest proposal
Alexandre Vassalotti
avassalotti at acm.org
Tue May 8 16:03:42 CEST 2007
On 5/8/07, Raymond Hettinger <python at rcn.com> wrote:
> If you're in the mood to propose something radical, how about dropping
> the colon altogether, leaving indention as the sure reliable cue and
> cleaning-up the appearance of code in a new world where colons
> are also being used for annotation as well as slicing:
>
> def f(x: xtype, y: type)
> result = []
> for i, elem in enumerate(x)
> if elem < 0
> result.append(y[:i])
> else
> result.append(y[i:])
> return result
>
> It looks very clean to my eyes.
>
This proposal is surely doomed is advance. If I remember well the
trailing colon comes from Python's precursor, ABC. They realized it
was not necessary for the parser but it did make the programs more
readable for humans.
Would it be a good idea, to continue this thread on Python-ideas? I
doubt such changes will be accepted, since we are now past the PEP
deadline for changes to the core language.
-- Alexandre
More information about the Python-3000
mailing list