[Patches] [ python-Patches-619614 ] fixes for Lib/compiler for 2.2.2

noreply@sourceforge.net noreply@sourceforge.net
Mon, 07 Oct 2002 05:02:40 -0700


Patches item #619614, was opened at 2002-10-07 12:14
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=619614&group_id=5470

Category: Library (Lib)
Group: Python 2.2.x
Status: Open
>Resolution: Accepted
Priority: 8
Submitted By: Michael Hudson (mwh)
>Assigned to: Michael Hudson (mwh)
Summary: fixes for Lib/compiler for 2.2.2

Initial Comment:
Here's a few fixes for the Lib/compiler package on the
release22-maint side.

With them, I can compile Lib/*.py, Lib/test/test_*.py
and run the test suite succesfully and without I can't,
so I'm fairly sure I've improved the situation, but I'd
still like a review.

I'd really like something to be done about this before
2.2.2b1...

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-07 14:02

Message:
Logged In: YES 
user_id=21627

I see. The patch looks fine to me, then; please apply it.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-10-07 13:41

Message:
Logged In: YES 
user_id=6656

No, they do have an effect: without them, the class's
docstring gets added to the enclosing scope!

[mwh@pc150 build-ucs2-debug]$ cat c.py
'Module docstring'

class C:
    'class docstring'

$ ./python ../Lib/compiler/pycodegen.py c.py
$ ./python 
...
>>> import c
>>> c.__doc__
'class docstring'
>>> c.C.__doc__
>>> 

One could change the node.emit()... stuff to gen.emit()...
stuff and take the code out of the __init__ method, but it
doesn't seem to make much difference to me.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-07 13:36

Message:
Logged In: YES 
user_id=21627

While the changes look all correct to me, I don't understand
the rationale for moving the class.__doc__ snippet. It looks
like this change has no effect.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=619614&group_id=5470