Re: Trellis throws an error related to metaclass in python 2.6.5
Christopher Stelma <[email protected]> Fri, 1 Oct 2010 10:44:48 -0400
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Sep 30, 2010 at 2:04 PM, P.J. Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote: > At 05:30 PM 9/29/2010 -0400, Christopher Stelma wrote: >> >> After seeing same error and the update to DecoratorTools in response, >> I applied a slightly different fix(?) for the problem. > > Sorry, I don't quite understand your question. Does the official fix break > something for you? It sort of sounds like you want to have classy ABCs, > except that you're also saying you don't use them. So, I'm confused. ;-) No, the official fix doesn't break anything for me. You're correct, I currently have no use for such a class, but I don't see why a "classy ABC" cannot exist. However, on second look, "super(classy_class, classy_class)" still isn't going to work 100% in the hypothetical case where there are more metaclasses to deal with, so my change is incomplete. I was going through diffs and, in the interests of library code, thought I'd post it. Without an actual use case, it doesn't matter whatsoever; feel free to ignore. > >> Instead of killing the ABCMeta methods in the definition of >> classy_class, in the three methods of classy, I replaced references to >> "type" with "super(classy_class, classy_class)". This lets >> ABCMeta.__new__ run when ABCMeta is the base class to do whatever >> setup is necessary, and skips straight back to type.__new__ when not. >> >> I'm not using any ABC's (directly), so is there any specific reason to >> disable it for classy sublclasses? > > -- Christopher Stelma Digsby Developer - digsby.com [email protected]