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


Groups > comp.lang.python > #8101

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!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:" ': 0.03; 'assign': 0.04; '2.x': 0.05; 'attributes': 0.05; 'classes.': 0.05; 'instance': 0.05; 'page?': 0.07; 'terry': 0.07; 'python': 0.08; '3.x': 0.09; 'arguments.': 0.09; 'builtin': 0.09; 'modifier': 0.09; 'object.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subclasses': 0.09; 'subject:create': 0.09; 'subject:object': 0.09; 'pm,': 0.10; 'written': 0.14; 'wrote:': 0.14; 'new-style': 0.16; 'old-style': 0.16; 'reedy': 0.16; 'subject: \n ': 0.16; 'subject:classes': 0.16; 'classes,': 0.19; "hasn't": 0.19; 'jan': 0.20; 'header:In- Reply-To:1': 0.21; 'subject:need': 0.22; "doesn't": 0.25; 'function': 0.25; 'classes': 0.26; 'object': 0.26; 'says': 0.27; "i'm": 0.27; '(the': 0.28; 'subject:?': 0.29; 'class.': 0.29; 'exists': 0.29; 'updated': 0.29; 'elsewhere': 0.30; 'seem': 0.32; "can't": 0.32; 'header:X-Complaints-To:1': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'thinking': 0.34; 'force': 0.34; 'core': 0.35; 'header:User-Agent:1': 0.35; 'instances': 0.35; 'yet,': 0.35; 'reference': 0.35; 'quite': 0.36; 'subject:new': 0.37; 'received:org': 0.38; 'subject:from': 0.38; 'but': 0.38; 'docs': 0.38; 'subject:: ': 0.38; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'john': 0.62; 'website': 0.66; 'concept': 0.73; 'anywhere.': 0.84; 'opposition': 0.84; 'can\x92t': 0.91; 'anymore,': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Do we still need to inherit from "object" to create new-style classes?
Date Tue, 21 Jun 2011 13:30:28 -0400
References <a99ab9f2-dfde-4107-a26d-7720bf6bf6d8@f7g2000yqf.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding quoted-printable
X-Gmane-NNTP-Posting-Host rain.gmane.org
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10
In-Reply-To <a99ab9f2-dfde-4107-a26d-7720bf6bf6d8@f7g2000yqf.googlegroups.com>
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.230.1308677449.1164.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 82.94.164.166
X-Trace 1308677449 news.xs4all.nl 49044 [::ffff:82.94.164.166]:47275
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8101

Show key headers only | View raw


On 6/20/2011 9:26 PM, John Salerno 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,

Lib ref 2. builtin functions:
"object()
Return a new featureless object. object is a base for all classes. It 
has the methods that are common to all instances of Python classes. This 
function does not accept any arguments.

Note
object does not have a __dict__, so you can’t assign arbitrary 
attributes to an instance of the object class.
"

> but elsewhere on
> the Python website it says the documentation hasn't been updated for
> new-style classes yet, hence my confusion.)

What page? *It* may need updating ;-).

The core 3.x docs have been updated by removing all reference to 
old-style classes and the modifier 'new-style'. The concept 'new-style' 
only exists in opposition to 'old-style'. 3.x just has classes, and all 
are subclasses of object.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious 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