[Python-Dev] class Foo(object) vs class Foo: should be clearly explained in python 2 and 3 doc (original) (raw)
Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Aug 10 17:51:51 CEST 2014
- Previous message: [Python-Dev] class Foo(object) vs class Foo: should be clearly explained in python 2 and 3 doc
- Next message: [Python-Dev] class Foo(object) vs class Foo: should be clearly explained in python 2 and 3 doc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Aug 9, 2014 at 8:44 PM, Steven D'Aprano <steve at pearwood.info> wrote:
It is certainly required when writing code that will behave the same in version 2 and 3
This is not true. An alternative is to put
metaclass = type
at the top of your module to make all classes in your module new-style in python2. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140810/5e03505a/attachment.html>
- Previous message: [Python-Dev] class Foo(object) vs class Foo: should be clearly explained in python 2 and 3 doc
- Next message: [Python-Dev] class Foo(object) vs class Foo: should be clearly explained in python 2 and 3 doc
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]