[Python-ideas] op-assign in function argument

wxyarv weasley_wx at qq.com
Wed Feb 24 07:23:29 CET 2010


has anybody thought the op-assign in function argument is a good idea? now we can use parameter name to specifie argument, like this:
  
 def foo(arg1): pass
  
 # call
 foo(arg1 = "bar")
  
 but, if function has default parameter, it will be inconvenience:
 def foo_with_long_defualts(arg1 = we | are | default | flags | set): pass
  
 # call
 foo_with_long_defaults(arg1 = we | are | default | flags | set | another_flags)
  
 so, why not add op-assign support in named argument?
  
 foo_with_long_defaults(arg1 |= another_flags)
  
  
 are there anybody has the same idea with me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100224/c7d5ee19/attachment.html>


More information about the Python-ideas mailing list