Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'assign': 0.07; 'class,': 0.07; 'inherited': 0.09; '"internal': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 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; 'wrote:': 0.18; 'mind.': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '"",': 0.31; 'file': 0.32; 'class': 0.32; '(most': 0.33; "i'd": 0.34; 'classes': 0.35; 'received:google.com': 0.35; 'acceptable': 0.36; 'to:addr:python-list': 0.38; 'fact': 0.38; 'recent': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; "you're": 0.61; 'subject:The': 0.64; 'actually,': 0.84; 'bare': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=JFBy1AdTJYbwK/yKOvcFfJAF8k1vVByGIbkj2JzpM+k=; b=LEFausVaptzZ3gQAwyUDoZYOtVxjORx0T+9zykfM8FzEY6nBUo4pQo8XsGY9exKEpI yZyjITtGM1ztcox1wEMHaN1ywTpLGKf1ZnZYTr88YzZ2pJz3Nk5qXo0SVXt6Z21GbiV6 YZ/RKwViW10Wj0AY75Ce3ikqcPZ+XrNvAniXe21txNeBK87CSZg9Pu603cIcNAqcIrO5 Tyut63BmIpVFFzlhoHR3m93FdhD6UAFmsF7TLj0OBDdgVrsTqGFLHqPLAUekQ5WKszWQ hXc0lbm4KikT1+jGxRIRYlPqqPA7N9vbSfV9+PT1lzDRSLOkJFwoq7jHgh3SyCoyZmLI KKMg== MIME-Version: 1.0 X-Received: by 10.52.91.71 with SMTP id cc7mr8717262vdb.58.1366065165348; Mon, 15 Apr 2013 15:32:45 -0700 (PDT) In-Reply-To: References: <516bd241$0$29872$c3e8da3$5496439d@news.astraweb.com> <516C3C44.6010706@rece.vub.ac.be> Date: Tue, 16 Apr 2013 08:32:45 +1000 Subject: Re: The type/object distinction and possible synthesis of OOP and imperative programming languages From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366065168 news.xs4all.nl 2673 [2001:888:2000:d::a6]:41736 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43647 On Tue, Apr 16, 2013 at 8:12 AM, Rotwang wrote: > Traceback (most recent call last): > File "", line 1, in > class C(type(lambda: None)): > TypeError: type 'function' is not an acceptable base type > > > and I don't think that FunctionType would be considered an "internal > detail", would it? Not that I'd cite the fact that not all types can be > inherited from as evidence that types and classes are not synonyms, mind. Actually, I'm not sure how you'd go about inheriting from a function. Why not just create a bare class, then assign its __call__ to be the function you're inheriting from? ChrisA