[Python-Dev] locals(), closures, and IronPython... (original) (raw)

Mike Klaas mike.klaas at gmail.com
Wed Mar 7 00:23:11 CET 2007


On 3/6/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

Although you can get a similar effect now by doing

def init(self, **kwds): args = dict(prec=None, rounding=None, traps=None, flags=None, roundingdecision=None, Emin=None, Emax=None, capitals=None, clamp=0, ignoredflags=None) args.update(kwds) for name, value in args: ... So, no need for locals() here.

Yes, that is the obvious approach. But it is painful to abandon the introspectable signature.

There's nothing quite like running help(func) and getting *args, **kwargs as the documented parameter list.

-Mike



More information about the Python-Dev mailing list