Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Andrew Dalke
On 3/6/07, Mike Klaas <[EMAIL PROTECTED]> wrote: > There's nothing quite like running help(func) and getting *args, > **kwargs as the documented parameter list. I think >>> import resource >>> help(resource.getpagesize) Help on built-in function getpagesize in module resource: getpagesize(...)

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Mike Klaas
On 3/6/07, Greg Ewing <[EMAIL PROTECTED]> 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, >_rounding_decision=None, >

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Greg Ewing
Andrew Dalke wrote: > def __init__(self, prec=None, rounding=None, > traps=None, flags=None, > _rounding_decision=None, > Emin=None, Emax=None, > capitals=None, _clamp=0, > _ignored_flags=None): > ..

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Dino Viehland
d Cc: Guido van Rossum; python-dev@python.org Subject: Re: [Python-Dev] locals(), closures, and IronPython... On 3/5/07, Dino Viehland <[EMAIL PROTECTED]> wrote: > Thanks Guido. It might take some time (and someone may very well beat me to > it if they care a lot) but I'll see if

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Aahz
On Tue, Mar 06, 2007, Andrew Dalke wrote: > On 3/5/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> >> I don't know too many good use cases for >> locals() apart from "learning about the implementation" I think this >> might be okay. > > Since I'm watching this list for any discussion on the tra

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Jeremy Hylton
ass to locals. Jeremy > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Guido van > Rossum > Sent: Monday, March 05, 2007 2:14 PM > To: Dino Viehland > Cc: python-dev@python.org > Subject: Re: [Python-Dev] locals(), closures, and I

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Andrew Dalke
On 3/5/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I don't know too many good use cases for > locals() apart from "learning about the implementation" I think this > might be okay. Since I'm watching this list for any discussion on the traceback threads, I figured I would point out the most c

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-05 Thread Terry Reedy
"Dino Viehland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] def a(): x = 4 y = 2 def b(): print y, locals() print locals() b() a() in CPython prints: {'y': 2, 'x': 4,

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-05 Thread Dino Viehland
Dino Viehland Cc: python-dev@python.org Subject: Re: [Python-Dev] locals(), closures, and IronPython... Jeremy Hylton has been asking questions about this too at the sprint after PyCon. I'm tempted to accept that the exact behavior of locals() is implementation-defined (IOW undefined :-) as

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-05 Thread Guido van Rossum
Jeremy Hylton has been asking questions about this too at the sprint after PyCon. I'm tempted to accept that the exact behavior of locals() is implementation-defined (IOW undefined :-) as long as it includes the locals defined in the current scope; whether it also includes free variables could be d

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

2007-03-05 Thread Dino Viehland
def a(): x = 4 y = 2 def b(): print y, locals() print locals() b() a() in CPython prints: {'y': 2, 'x': 4, 'b': } 2 {'y': 2} I'm wondering if it's intentional that these don't print d