On 17Jul2011 15:54, ΤΖΩΤΖΙΟΥ <tzotz...@gmail.com> wrote:
| 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)
[...]
| There is also a big window for misuse (i.e. break the function/method
| name in illogical places), but I would classify this under “consenting
| adults”. It might be suggested as good form that function names break
| at underscores, like my examples.

Another problem is the scope for error. I can easily imagine typing:

  x=foo(x)bah(y)

when I intended to type:

  x=foo(x)+bah(y)

Adding your syntax causes silent breakage later instead of immediate
syntax error now.

Cheers,
-- 
Cameron Simpson <c...@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

hybrid rather than pure; compromising rather than clean;
distorted rather than straightforward; ambiguous rather than
articulated; both-and rather than either-or; the difficult
unity of inclusion rather than the easy unity of exclusion.
        - Paul Barton-Davis <pa...@cs.washington.edu>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to