Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'classes,': 0.05; 'python3': 0.07; '"class"': 0.09; 'objects:': 0.09; 'python': 0.11; 'distinct': 0.16; 'mechanism.': 0.16; 'subclass': 0.16; 'subject: \n ': 0.16; 'subject:OOP': 0.16; 'subject:object': 0.16; 'subject:possible': 0.16; 'subject:programming': 0.16; 'subject:type': 0.16; 'tried:': 0.16; 'typeerror:': 0.16; 'types,': 0.16; "python's": 0.19; 'written': 0.21; 'seems': 0.21; 'feb': 0.22; '>>>': 0.22; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'class.': 0.26; 'pass': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; '"",': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'class': 0.32; '(most': 0.33; 'entirely': 0.33; 'could': 0.34; 'classes': 0.35; 'but': 0.35; 'acceptable': 0.36; 'keyword': 0.36; 'two': 0.37; 'starting': 0.37; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'simply': 0.61; 'subject:The': 0.64; 'more': 0.64; 'gotten': 0.74; '100%': 0.77; 'received:195.238': 0.84; 'received:195.238.6': 0.84; 'received:belgacom.be': 0.84; 'received:isp.belgacom.be': 0.84; '2013,': 0.91; 'hopes': 0.91 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcDAKQ6bFFbs/O//2dsb2JhbAANQ8FWgmYDAYEdgxMBAQEDAThAEQshFg8JAwIBAgFFEwgCiAqoXooKiRGJdYRDZhaDKwOXBZJmgTg Date: Mon, 15 Apr 2013 19:43:32 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: The type/object distinction and possible synthesis of OOP and imperative programming languages References: <516bd241$0$29872$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <516bd241$0$29872$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366047882 news.xs4all.nl 2623 [2001:888:2000:d::a6]:58746 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43631 Op 15-04-13 12:11, Steven D'Aprano schreef: > > Python's data model has always been 100% object oriented. Prior to the > "class/type" unification, it simply had *two distinct* implementations of > objects: types, which were written in C, and classes, which were written > in Python. > > After unification, the two kinds of object were no longer entirely > distinct -- you could then subclass types in Python code, using the same > "class" keyword as you would use for a pure-Python class. > > And starting with Python 3, the last vestiges of the distinction have > disappeared. Now, "class" and "type" are mere synonyms. Both built-in > types and custom classes use the same mechanism. I had gotten my hopes up after reading this but then I tried: $ python3 Python 3.2.3 (default, Feb 20 2013, 17:02:41) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class vslice (slice): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type 'slice' is not an acceptable base type It seems types and classes are still not mere synonyms.