Extending Python Syntax with @

John Roth newsgroups at jhrothjr.com
Thu Mar 11 13:03:27 EST 2004


"David MacQuigg" <dmq at gain.com> wrote in message
news:u39150l2218blgkduajrrlsju7760sclpd at 4ax.com...
> On Thu, 11 Mar 2004 11:17:08 -0500, "John Roth"
> <newsgroups at jhrothjr.com> wrote:
>
> >"David MacQuigg" <dmq at gain.com> wrote in message
> >news:mu2150t5ppk9f0n89uhkijtce2htsga2dg at 4ax.com...
>
> >> Wow!!  And I thought it was just me.  Could you point me to a PEP or
> >> other discussion?  I would sure like to know the history of this.
> >> Could it be that in adding "lambda calculus" to Python, Guido was
> >> snowed by the language theorists? <half wink>
> >
> >There's a presentation on the Python site - go to Doc, then to
> >Guido's Essay's, then to Presentations. It's called Python Regrets.
> >Google has an HTML version if you use "Python Regrets Guido"
> >as the keywords.
>
> http://python.org/doc/essays/ppt/regrets/6
> Interesting that Guido says lambda is confusing.
>
> Interesting also that he is proposing two functions in place of
> print(x,y,z):
>    write(x,y,z)
>    writeln(x,y,z)
> This sounds very similar to Paul Prescod's proposal a few days ago on
> this newsgroup, except that Paul is proposing to do it all with one
> show() function.  I like the one function.

There's also a basic difference. Write takes a string (or
strings with the proposal). Print took anything and called
str() or repr() to convert.

The difference between write and writeln is that the latter
puts in the return. Since it's on Guido's list, and since I
don't think it will cause compatibility problems, I suspect
that a patch to do it wouldn't be rejected out of hand. I'd
suggest making writeln (which is a new method) default
to inserting a single space, and leave write to default to
not inserting anything between the strings. (And remember
to do the doc update at the same time - the core developers
really like that.)

> Other surprises:  Deprecating reload()

Reload doesn't work the way most people think
it does: if you've got any references to the old module,
they stay around. They aren't replaced.

It was a good idea, but the implementation simply
doesn't do what the idea promises.

>
> Thanks for the link.

You're welcome.

>
> -- Dave

John Roth
>





More information about the Python-list mailing list