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


Groups > comp.lang.python > #8050

Re: Do we still need to inherit from "object" to create new-style classes?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <bsk16@case.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:" ': 0.03; '2.x': 0.05; 'python': 0.08; '3.x': 0.09; 'object.': 0.09; 'subclass': 0.09; 'subject:create': 0.09; 'subject:object': 0.09; 'pm,': 0.10; 'written': 0.14; 'wrote:': 0.14; 'altogether,': 0.16; 'new-style': 0.16; 'old-style': 0.16; 'subject:classes': 0.16; 'mon,': 0.17; "hasn't": 0.19; 'header:In-Reply-To:1': 0.21; 'subject:need': 0.22; "doesn't": 0.25; 'classes': 0.26; 'object': 0.26; 'says': 0.27; 'thanks.': 0.27; "i'm": 0.27; 'message-id:@mail.gmail.com': 0.28; '(the': 0.28; 'subject:?': 0.29; 'explicitly': 0.29; 'rid': 0.29; 'updated': 0.29; 'elsewhere': 0.30; 'seem': 0.32; "can't": 0.32; 'to:addr:python-list': 0.33; 'thinking': 0.34; 'force': 0.34; 'yet,': 0.35; 'quite': 0.36; 'subject:new': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.37; '20,': 0.37; 'subject:from': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'got': 0.39; 'to:addr:python.org': 0.39; 'john': 0.62; 'website': 0.66; 'anywhere.': 0.84; 'anymore,': 0.95
MIME-Version 1.0
In-Reply-To <a99ab9f2-dfde-4107-a26d-7720bf6bf6d8@f7g2000yqf.googlegroups.com>
References <a99ab9f2-dfde-4107-a26d-7720bf6bf6d8@f7g2000yqf.googlegroups.com>
Date Mon, 20 Jun 2011 18:33:38 -0700
Subject Re: Do we still need to inherit from "object" to create new-style classes?
From Benjamin Kaplan <benjamin.kaplan@case.edu>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-Junkmail-Status score=10/49, host=mpv1.tis.cwru.edu
X-Junkmail-Signature-Raw score=unknown, refid=str=0001.0A020205.4DFFF4F3.007E,ss=1,fgs=0, ip=209.85.210.54, so=2010-12-23 16:51:53, dmn=2009-09-10 00:05:08, mode=single engine
X-Junkmail-IWF false
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.206.1308620023.1164.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 82.94.164.166
X-Trace 1308620023 news.xs4all.nl 49045 [::ffff:82.94.164.166]:42060
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8050

Show key headers only | View raw


On Mon, Jun 20, 2011 at 6:26 PM, John Salerno <johnjsal@gmail.com> wrote:
> I can't quite seem to find the answer to this anywhere. The book I'm
> reading right now was written for Python 3.1 and doesn't use (object),
> so I'm thinking that was just a way to force new-style classes in 2.x
> and is no longer necessary in 3.x. Is that right?
>
> (The documentation doesn't mention object anymore, but elsewhere on
> the Python website it says the documentation hasn't been updated for
> new-style classes yet, hence my confusion.)
>
> Thanks.

3.x got rid of old-style classes altogether, so you are correct-
there's no need to explicitly subclass object.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Do we still need to inherit from "object" to create new-style classes? John Salerno <johnjsal@gmail.com> - 2011-06-20 18:26 -0700
  Re: Do we still need to inherit from "object" to create new-style classes? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-06-20 18:33 -0700
    Re: Do we still need to inherit from "object" to create new-style classes? John Salerno <johnjsal@gmail.com> - 2011-06-20 19:13 -0700
  Re: Do we still need to inherit from "object" to create new-style classes? Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 12:41 +1000
  Re: Do we still need to inherit from "object" to create new-style classes? Terry Reedy <tjreedy@udel.edu> - 2011-06-21 13:30 -0400

csiph-web