Patches item #1681101, was opened at 2007-03-14 20:09 Message generated for change (Comment added) made by gvanrossum You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1681101&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core (C code) Group: Python 3000 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Guido van Rossum (gvanrossum) Summary: PEP 3115 patch Initial Comment: A patch for PEP 3115 (metaclass syntax for Py3k). This enables full [arglist] syntax in the class header, e.g. class C(B1, B2, metaclass=MC, *more_bases, **kwds): pass ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2007-03-16 11:53 Message: Logged In: YES user_id=6380 Originator: YES New patch, gets rid of LOAD_LOCALS and BUILD_CLASS opcodes and adds LOAD_BUILD_CLASS opcode which avoids looking for __build_class__ in the globals; it only searches the builtins (like the IMPORT statement). Though this is debatable. File Added: meta.patch ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2007-03-16 00:11 Message: Logged In: YES user_id=6380 Originator: YES Here's a new version that implements __build_class__ in C. It's still an ordinary built-in function loaded using LOAD_GLOBAL so you can play games with this; however I'd rather keep that an implementation detail and not a feature (unlike overriding __import__, which *is* a feature). One thing that's missing is support for __metaclass__, either in the module, or in the class. I don't want to support those (maybe the PEP should mention this), but we need a fixer for 2to3 to warn about this, at least (and to convert class C: __metaclass__ = M; ... into class C(metaclass=M): ...). BTW, the test_grp failure mentioned earlier is bogus; that's an artefact of Google's LDAP. Some more tests probably fail, but I'll worry about those later. File Added: meta.patch ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2007-03-15 17:53 Message: Logged In: YES user_id=6380 Originator: YES New version. Fixes problems with bsddb, removes dead declaration from bltinmodule.c, and updates outdated docs for MAKE_FUNCTION and MAKE_CLOSURE in opcode.h while I was at it. File Added: meta.patch ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2007-03-15 17:06 Message: Logged In: YES user_id=6380 Originator: YES Here's a new patch, which generates correct code for all variants of the class header syntax. For now, I've implemented __build_class__ in Python; the built-in function by that name imports the build_class module and calls its build_class function. (I'll later redo this in C.) This is still rough; I didn't even delete the old BUILD_CLASS opcode. But only a few unit tests fail (especially the ast and compiler tests). There are no unit tests for the new functionality. There is no documentation. Failing tests: test_ast test_compiler test_ctypes test_descr test_grp test_pep292 File Added: meta.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1681101&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches