Leif Walsh wrote: > That said, it seems to me that if we're going to add to > functools.partial, we should go all the way and allow keyword > arguments (or a dict of them, if it's otherwise too hard to > implement). Otherwise, in another few {days, weeks, months} we'll see > another thread like this clamoring for a keyword-sensitive > functools.partial.
functools.partial *does* support keyword arguments - it's just that some functions and methods written in C (such as string methods) *don't*, so partial's keyword support doesn't help. A functools.rpartial would go some way towards addressing that. Using the standalone Ellipsis to denote missing arguments would probably start to miss the whole point of functools.partial: the only reason for its existence is that it is *faster than the equivalent Python function*. If partial starts messing about looking for missing arguments and then slotting them in, then it is likely to slow down to the point where you would be better off skipping it and writing a dedicated function that adds the extra arguments. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com