37defformatf((argn, argt), fchar):
38"""format for getopt(),39 argn is the flag, argt is its type, fchar is one of ':' or '='"""40return argt == bool and argn.lstrip('-') or"%s%s" % (argn.lstrip('-'), fchar)
41

The formatf() function above returns the single and multi-character command line flags in the format required by getopt().

I started playing with one of the python2.5 features, namely functools.partial() that allows one to effectively “construct variants of existing functions that have some of the parameters filled in” (quote from Functional Programming HOWTO).

In the code below I am trying to preset the second paramater of the operator.lt() built-in function.

The refusal on the part of python’s built-in functions to accept keyword arguments seems odd since it introduces somewhat of an inconsistency (built-in functions differing from “normal” functions in that regard).

I am wondering why this seeming inconsistency was introduced to python, a language that prides itself on a clean design.