Benjamin Peterson [EMAIL PROTECTED] added the comment:
Added in r66438.
One open issue is that the comment is lost in the following example:
class X:
__metaclass__ = Meta # Spam
--
resolution: - fixed
status: open - closed
___
Python tracker
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Good work on the patch! It looks pretty good. I'm attaching a patch with
a few minor changes. I don't really understand the need for
fixup_parse_tree, since I see in the Grammar that a suite is required
for every classdef.
Benjamin Peterson [EMAIL PROTECTED] added the comment:
On Thu, Aug 21, 2008 at 9:38 PM, Jack Diederich [EMAIL PROTECTED] wrote:
Jack Diederich [EMAIL PROTECTED] added the comment:
Benjamin, the 2to3 parse tree straddles the 2.x Grammar and 3.x Grammar
(it's its own thing) which is why
Jack Diederich [EMAIL PROTECTED] added the comment:
Thanks for the ping. I just rewrote the patch from scratch and it
handles corner cases (of which there are many in the parse tree) better.
I'll upload/checkin sometime today.
___
Python tracker [EMAIL
Jack Diederich [EMAIL PROTECTED] added the comment:
The new patch works and handles all the corner cases I could think of.
I tried to comment the heck out of it because it does a lot of manual
walking and manipulation of the syntax tree.
This only handles __metaclass__ inside classes. I
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Ping
--
nosy: +benjamin.peterson
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2366
___
___
Jack Diederich [EMAIL PROTECTED] added the comment:
New patch that does more. Collin, could you take a look at the fixer?
I listed some stumbling blocks at the top (and at least one bug in
2to3). The fixer seems to work fine on actual files but the unit tests
that use strings do nothing.
Collin Winter [EMAIL PROTECTED] added the comment:
A quick test indicates that the old way doesn't work anymore.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2366
__
___
Jack Diederich [EMAIL PROTECTED] added the comment:
Here is a partial implementation. It doesn't warn about __metaclass__
at the module level and doesn't handle multiple __metaclass__
assignements in one class. tests pending.
--
keywords: +patch
Added file:
New submission from Brett Cannon [EMAIL PROTECTED]:
* new metaclass syntax (removing __metaclass__?)
- __metaclass__ = type at global level disappear
- __metaclass__ = anything else should generate warning
- __metaclass__ = something within a class should use new syntax
- class
Changes by Jack Diederich [EMAIL PROTECTED]:
--
nosy: +jackdied
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2366
__
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Brett Cannon [EMAIL PROTECTED]:
--
priority: immediate - urgent
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2366
__
___
Python-bugs-list mailing list
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Does the old way still work in 3.0? If so, I don't think we should have
a fixer.
--
nosy: +rhettinger
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2366
__
13 matches
Mail list logo