Python dot-equals (syntax proposal)

Chris Rebert clp2 at rebertia.com
Fri Apr 30 13:24:06 EDT 2010


On Fri, Apr 30, 2010 at 10:05 AM, John Bokma <john at castleamber.com> wrote:
> "D'Arcy J.M. Cain" <darcy at druid.net> writes:
>> On Fri, 30 Apr 2010 09:04:59 -0700 (PDT)
>> Jabapyth <jabapyth at gmail.com> wrote:
>>> foo = "Hello world"
>>> foo.=split(" ")
>>
>> Isn't;
>>
>> foo = "Hello world"
>> bar = foo.split() # side note - split() splits on whitespace by default
>>
>> so much clearer?  Do you really want to see Python turn into Perl?
>
> Oh, boy, there we go again. Can you and your buddies please refrain from
> using Perl as a kind of uber-argument? Just write why you think it's
> wrong. Bonus points if you can use Python in your arguments.
>
> Why I am asking this is that most "Oh, like Perl" statements I've seen
> the past months were made by people who either haven't used Perl
> themselves or have very little skill in the language. This is a Python
> group.
>
> On top of that, it's not possible in Perl (heh, no surprise there). The
> only thing that comes close is:

Actually/ironically, it does appear to be in Perl 6:
"""
Mutating method call
    $obj.=meth
The .= operator does inplace modification of the object on the left.
""" -- Synopsis 3: Perl 6 Operators (http://feather.perl6.nl/syn/S03.html)

Cheers,
Chris
--
One phrase: "Periodic Table of the Operators"
http://blog.rebertia.com



More information about the Python-list mailing list