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


Groups > comp.lang.python > #3628

meteclasses 2.x/3.x compatibility

From James Mills <prologic@shortcircuit.net.au>
Date 2011-04-20 11:56 +1000
Subject meteclasses 2.x/3.x compatibility
Newsgroups comp.lang.python
Message-ID <mailman.600.1303264623.9059.python-list@python.org> (permalink)

Show all headers | 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