I don't mind the naked star and will be happy if thats what we end up with.
Though how about using *None?
I think that makes the intention of the function clearer.
eg.
def compare(a, b, *None, key=None):
Which to me reads as no further positional arguments.
Or alternatively:
def compare(a, b,
None is not currently a keyword
--
http://mail.python.org/mailman/listinfo/python-list
molasses wrote:
I don't mind the naked star and will be happy if thats what we end up with.
Though how about using *None?
I think that makes the intention of the function clearer.
eg.
def compare(a, b, *None, key=None):
Which to me reads as no further positional arguments.
Or
In article [EMAIL PROTECTED],
Talin [EMAIL PROTECTED] wrote:
(Note: PEPs in the 3xxx number range are intended for Python 3000,
however this particular PEP may be backported if there is support for
it.)
PEP: 3102
Title: Keyword-Only Arguments
...
Syntactically, the proposed changes
Allowing keyword arguments without defaults may seem like a syntactical
change, but in fact it's not. You can do this in Python now - any
argument can be a 'keyword' argument, whether it has a default value or
not. So for example:
def func( a, b, c=0 ):
pass
func( a=1, b=2, c=3 )
In other
Talin wrote:
Specification
Syntactically, the proposed changes are fairly simple. The first
change is to allow regular arguments to appear after a varargs
argument:
def sortwords(*wordlist, case_sensitive=False):
...
This function accepts any number
(Note: PEPs in the 3xxx number range are intended for Python 3000,
however this particular PEP may be backported if there is support for
it.)
PEP: 3102
Title: Keyword-Only Arguments
Version: $Revision: 46053 $
Last-Modified: $Date: 2006-05-19 22:23:44 -0700 (Fri, 19 May 2006) $
Author: Talin