Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'subject:Python': 0.06; 'attribute': 0.07; 'expressions': 0.07; 'literal': 0.09; 'parsing': 0.09; 'works.': 0.09; 'python': 0.11; 'def': 0.12; 'ah,': 0.16; 'different?': 0.16; 'earlier.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inheritance': 0.16; 'magic': 0.16; 'operators,': 0.16; 'quirks': 0.16; 'rule.': 0.16; 'subject:user': 0.16; 'sup': 0.16; 'wrote:': 0.18; 'instance,': 0.24; 'looks': 0.24; 'somewhere': 0.26; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'piece': 0.31; 'class': 0.32; 'languages': 0.32; 'cases': 0.33; 'skip:_ 10': 0.34; 'something': 0.35; 'late': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'doing': 0.36; 'subject:New': 0.37; 'too': 0.37; 'two': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'little': 0.38; 'does': 0.39; 'aside': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; 'subject: / ': 0.60; 'break': 0.61; 'mentioned': 0.61; 'making': 0.63; 'face': 0.64; 'special': 0.74; 'goal': 0.75; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SQrn+gSiaOvKJrQ3NSdaRCA2/QgG1IEJoUzjxwH4EFQ=; b=eeV7zDnEgYfNk8sgvAzkZUA+f7GGrFn4+HUqNFBmBOPvAKUveuY28WenpaVhPC36m3 ywk29ZnC+4ptFt+jl8X4JGJhO4XFpEc0lDHi775+uYqAZcuVVzdDMNyx5Rgq45W41fVB rSYW++kai51DIb1mYlvyTR0ty2cdHPyjV4+1BfAj0NIATSEckaaTN+PuIgwRcPjHek8o jAgqIeNk8rmC4NajXaVj7YwQenG2UKl8UmFZtBz7EFDJi2gYxzPYlVxqOHfpjXHB++yO +jJo3DdiTC3a7x7RYhjm8T5OG8CcCAk2XT9JeWMvdc1+5fKszbQfXj8YxPu6mcXDaDIG MqCQ== MIME-Version: 1.0 X-Received: by 10.66.25.168 with SMTP id d8mr2478623pag.123.1384083828707; Sun, 10 Nov 2013 03:43:48 -0800 (PST) In-Reply-To: References: <-JadnUirYuhUruPPnZ2dnUVZ8rSdnZ2d@bt.com> Date: Sun, 10 Nov 2013 22:43:48 +1100 Subject: Re: New user's initial thoughts / criticisms of Python 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384083837 news.xs4all.nl 15914 [2001:888:2000:d::a6]:36625 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59001 On Sun, Nov 10, 2013 at 10:39 PM, Ian Kelly wrote: > On Sun, Nov 10, 2013 at 2:22 AM, Chris Angelico wrote: >> JavaScript has magic around the dot and function-call operators, as I >> mentioned earlier. Lots of other languages have some little quirk >> somewhere that breaks this rule; some have a LOT of quirks that break >> this rule. Does Python have any? Aside from parsing oddities like >> attribute access on a literal integer[1], are there any cases where >> two expressions yielding the same object are in any way different? > > I can think of one: > > class Spam: > def __init__(self): > super().__init__() # This works. > > sup = super > > class Eggs: > def __init__(self): > sup().__init__() # This doesn't. Ah, yes, super() is magical. In that particular instance, I think the magic is better than the alternative, but let's face it: Multiple inheritance is an inherently hard problem, so a solution that has so little magic and manages to achieve the goal is doing well. The only thing that would have been better than this would be making it a piece of special syntax rather than something that looks like a function call, but it's too late to change now. ChrisA