Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'builtin': 0.09; 'classes.': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'patch.': 0.09; 'received:184.172': 0.09; 'received:gator410.hostgator.com': 0.09; 'try:': 0.09; '~ethan~': 0.09; 'jan': 0.12; 'bool': 0.16; 'builtins': 0.16; 'reedy': 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; 'typeerror:': 0.16; '{})': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'mon,': 0.24; '15,': 0.26; 'pass': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'leave': 0.29; 'am,': 0.29; '"",': 0.31; 'file': 0.32; 'class': 0.32; '(most': 0.33; 'except': 0.35; 'one,': 0.35; 'acceptable': 0.36; 'charset:us-ascii': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; 'received:173': 0.61; 'skip:n 10': 0.64; 'decided': 0.64; 'our': 0.64; 'subject:The': 0.64; 'here': 0.66; 'believe': 0.68; 'other.': 0.75; "'range'": 0.84; '2013': 0.98 Date: Tue, 16 Apr 2013 10:29:18 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 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> <516C3C44.6010706@rece.vub.ac.be> <516cb85b$0$29977$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.235]) [173.12.184.235]:58185 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366134722 news.xs4all.nl 2660 [2001:888:2000:d::a6]:37053 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43693 On 04/16/2013 01:25 AM, Serhiy Storchaka wrote: > On 16.04.13 07:46, Ian Kelly wrote: >> On Mon, Apr 15, 2013 at 9:17 PM, Terry Jan Reedy wrote: >>> I will keep the above in mind if I write or review a patch. here are 4 >>> non-subclassable builtin classes. Two are already documented. Bool in one, >>> forget which other. I believe it was recently decided to leave the other two >>> as is given the absence of any practical use case. >> >> The four are bool, NoneType, slice and ellipsis, I believe. > > --> import builtins > --> for n in dir(builtins): > ... if type(getattr(builtins, n)) is type: > ... try: > ... t = type(n, (getattr(builtins, n),), {}) > ... except TypeError as e: > ... print(e) > ... > type 'bool' is not an acceptable base type > type 'memoryview' is not an acceptable base type > type 'range' is not an acceptable base type > type 'slice' is not an acceptable base type Well that bumps our count to five then: --> NoneType = type(None) --> NoneType --> class MoreNone(NoneType): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type 'NoneType' is not an acceptable base type -- ~Ethan~