Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3628

meteclasses 2.x/3.x compatibility

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 <prologic@shortcircuit.net.au>
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 <prologic@shortcircuit.net.au>
Date Wed, 20 Apr 2011 11:56:35 +1000
Subject meteclasses 2.x/3.x compatibility
To python list <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.600.1303264623.9059.python-list@python.org> (permalink)
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

Show key headers only | View raw


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"

Back to comp.lang.python | Previous | NextNext in thread | Find similar


Thread

meteclasses 2.x/3.x compatibility James Mills <prologic@shortcircuit.net.au> - 2011-04-20 11:56 +1000
  Re: meteclasses 2.x/3.x compatibility Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-20 09:56 +0000

csiph-web