Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30097
| References | <2e8a9e88-9e7e-43f7-a070-ea9054e625f2@googlegroups.com> |
|---|---|
| Date | 2012-09-26 01:05 +1000 |
| Subject | Re: new-style class or old-style class? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1344.1348585527.27098.python-list@python.org> (permalink) |
On Wed, Sep 26, 2012 at 12:44 AM, Jayden <jayden.shui@gmail.com> wrote: > In learning Python, I found there are two types of classes? Which one are widely used in new Python code? Is the new-style much better than old-style? Thanks!! Definitely go with new-style. In Python 3, old-style classes aren't supported, and the syntax that would create an old-style class in Python 2 will implicitly create a new-style class. (Explicitly subclassing object still works in Py3, so you can happily use that syntax for both.) ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
new-style class or old-style class? Jayden <jayden.shui@gmail.com> - 2012-09-25 07:44 -0700
Re: new-style class or old-style class? "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-09-25 09:02 -0600
Re: new-style class or old-style class? Chris Angelico <rosuav@gmail.com> - 2012-09-26 01:05 +1000
Re: new-style class or old-style class? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-25 16:20 +0000
Re: new-style class or old-style class? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 19:45 +0100
Re: new-style class or old-style class? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 12:33 -0400
Re: new-style class or old-style class? Ramchandra Apte <maniandram01@gmail.com> - 2012-09-26 05:59 -0700
Re: new-style class or old-style class? Roy Smith <roy@panix.com> - 2012-09-26 09:12 -0400
Re: new-style class or old-style class? wxjmfauth@gmail.com - 2012-09-26 13:15 -0700
Re: new-style class or old-style class? alex23 <wuwei23@gmail.com> - 2012-09-26 17:30 -0700
csiph-web