2011/7/17 ΤΖΩΤΖΙΟΥ <tzotz...@gmail.com>: > Jumping in: > > What if a construct > > xx(*args1, **kwargs1)yy(*args2, **kwargs2) > > was interpreted as > > xxyy(*(args1+args2), **(kwargs1+kwargs2)) > > (Note: with **(kwargs1+kwargs2) I mean "put keyword arguments in the > order given", since dicts can't be added) > > This construct is currently a syntax error. The intent of this idea is > to help improve legibility. > > Example: > def place_at(item, x, y): blah blah > could be called as > place(item)_at(x, y)
class place(object): def __init__(self, item): self.__item = item def at(self, x, y): # place self.__item at (x, y) pass Then you can do: place(item).at(x, y) No syntax changes required. :-) -- http://mail.python.org/mailman/listinfo/python-list