Python dot-equals (syntax proposal)

Jabapyth jabapyth at gmail.com
Fri Apr 30 12:04:59 EDT 2010


At least a few times a day I wish python had the following shortcut
syntax:

vbl.=func(args)

this would be equivalent to

vbl = vbl.func(args)

example:

foo = "Hello world"
foo.=split(" ")
print foo
# ['Hello', 'world']

and I guess you could generalize this to

vbl.=[some text]
#
vbl = vbl.[some text]

e.g.

temp.=children[0]
# temp = temp.children[0]

thoughts?



More information about the Python-list mailing list