J. Cliff Dyer, 30.04.2010 18:20:
On Fri, 2010-04-30 at 09:04 -0700, Jabapyth wrote:
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?
That's kind of a nifty idea. However, python is currently under a
syntax moratorium. No syntax changes will be accepted for at least 24
months starting from the release date of Python 3.1. See more details
here: http://www.python.org/dev/peps/pep-3003/
In any case, the right place to discuss this is the python-ideas list.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list