Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'wed,': 0.04; 'received:209.85.213.46': 0.07; 'received:mail- yw0-f46.google.com': 0.07; 'subclasses': 0.09; 'to:name:python list': 0.09; 'pm,': 0.11; 'url:code': 0.11; 'wrote:': 0.14; 'wins': 0.16; '{})': 0.16; 'header:In-Reply-To:1': 0.22; 'received:209.85.213': 0.23; 'message-id:@mail.gmail.com': 0.28; 'changes': 0.29; 'solved': 0.31; 'url:src': 0.31; 'second': 0.31; 'to:addr:python-list': 0.32; 'thank': 0.32; 'example,': 0.33; 'using': 0.34; 'subject:/': 0.36; 'url:source': 0.36; 'two': 0.37; 'received:209.85': 0.37; '20,': 0.38; 'andrew': 0.38; 'apr': 0.38; 'received:google.com': 0.38; 'url:google': 0.38; 'so,': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; '2011': 0.62; 'url:p': 0.63; 'andrew.': 0.84 MIME-Version: 1.0 In-Reply-To: References: From: James Mills Date: Thu, 21 Apr 2011 08:36:31 +1000 Subject: Re: meteclasses 2.x/3.x compatibility To: python list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1303339014 news.xs4all.nl 34849 [::ffff:82.94.164.166]:52467 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3756 On Wed, Apr 20, 2011 at 10:18 PM, andrew cooke wrote: > What I do in Lepl is use two stages. =C2=A0The first calls the type/metac= lass directly and the second subclasses that. =C2=A0This avoids using the "= sugar" that changes between 2 and 3. > > So, for example, in http://code.google.com/p/lepl/source/browse/src/lepl/= matchers/matcher.py#40 I have > > =C2=A0_Matcher =3D ABCMeta('_Matcher', (object, ), {}) > > and then > > =C2=A0class Matcher(_Matcher): > =C2=A0 =C2=A0 =C2=A0... Thank Andrew. I like this approach Elegance wins for me :) cheers James --=20 -- James Mills -- -- "Problems are solved by method"