At 11:42 AM 5/25/2006 +0200, Baptiste Carvello <[EMAIL PROTECTED]> wrote:
>maybe those use cases can work without syntactic sugar. With only part 1, you
>can already add a manual check if you need:
>
>  >>> def myfunction(a1, a2, *forbidden, kw1, kw2):
>...    assert forbidden is (), "myfunction() takes exactly 2 arguments"
>...    pass
>  >>>

How about:

     def myfunction(a1, a2, *(), kw1, kw2):

This seems to me to mean "an empty varargs parameter" on its face, and it 
has the advantage of being a valid call syntax.  That is, you can already 
invoke "myfunction(1,2,*())" and it's syntactically valid and means the 
same thing.

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to