Python dot-equals (syntax proposal)

D'Arcy J.M. Cain darcy at druid.net
Fri Apr 30 12:34:34 EDT 2010


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?

However, if you really want to propose this you should be clear about
which of the following you mean.

foo .= split()
     or
foo. = split()

I assume you mean the former to be analagous to "+=" and friends but I
am not sure since "." isn't an operator.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list