Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!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.041 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.01; '2.x': 0.05; 'python': 0.07; '3.x': 0.09; 'to:name:python list': 0.09; '(2.6': 0.16; 'thanks,': 0.17; 'compatible': 0.20; 'pass': 0.27; 'message- id:@mail.gmail.com': 0.28; 'class': 0.29; 'solved': 0.31; 'all,': 0.31; 'to:addr:python-list': 0.32; 'there': 0.35; 'subject:/': 0.36; 'received:209.85': 0.37; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; '(3.0': 0.84; 'received:209.85.218.46': 0.91; 'received:mail-yi0-f46.google.com': 0.91 MIME-Version: 1.0 From: James Mills Date: Wed, 20 Apr 2011 11:56:35 +1000 Subject: meteclasses 2.x/3.x compatibility To: python list Content-Type: text/plain; charset=UTF-8 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: 26 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1303264624 news.xs4all.nl 41102 [::ffff:82.94.164.166]:41520 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3628 Hi all, Is there a compatible way to use meteclasses in both Python 2.x (2.6 to 2.7) and Python 3.x (3.0 to 3.2). Python 2.x: class Foo(object): __meteclass__ = MyMetaClass Python 3.x: class Foo(metaclass=MyMetaClass): pass Thanks, cheers James -- -- James Mills -- -- "Problems are solved by method"