Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '"this': 0.03; 'anyway.': 0.05; 'semantic': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fuzzy': 0.16; 'subclass': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'finished': 0.19; 'programming': 0.22; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'earlier': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'resolution': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'languages': 0.32; 'run': 0.32; 'monday,': 0.33; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'two': 0.37; 'area': 0.37; 'pm,': 0.38; 'anything': 0.39; 'sure': 0.39; 'how': 0.40; 'even': 0.60; 'name': 0.63; 'such': 0.63; 'different': 0.65; 'between': 0.67; 'analysis': 0.75; '2015': 0.84; 'to:none': 0.92 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:cc :content-type; bh=XB9FJw54J+kEdstiL15f21UjT2gDs7qu0E7lJ6E996s=; b=DXJnIDGlduXsPhWn1AuiIJo5OX2/MPhdAUIoNRIZR/HXcyDgKTZe/u0+ibjwZG4BS+ ngjHCqvRFiZkcXm9NFptXLK2ft45a0005RecIDOUhUBv3HMF+5Xb52J5djC/j195cutU V5fhbd6fQoI4WdHUqIaYB9jzW2mPAEHBXcMyKNkBYjboE5hhswRI+3CoozqThtLI7DZV G2LythkLlvZwv5Aaz/FffZPfC8ircYYVV6Hz+G0iG3BdRLPNY4/Csxe9xy9lTgb6qGOU amhivJD/65R6RkmFzslo8JbGdjcfHZHyem9ppR5wvrUNLXdZwbyni+zt+rocFQJWYPKc cxmw== MIME-Version: 1.0 X-Received: by 10.43.39.1 with SMTP id tk1mr8705687icb.26.1431310826321; Sun, 10 May 2015 19:20:26 -0700 (PDT) In-Reply-To: <9f72c817-3127-479a-86b5-132eed7b4f96@googlegroups.com> References: <7169d38e-b21c-472e-b0e3-544ed37fbfd2@googlegroups.com> <9f72c817-3127-479a-86b5-132eed7b4f96@googlegroups.com> Date: Mon, 11 May 2015 12:20:26 +1000 Subject: Re: anomaly From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431310828 news.xs4all.nl 2896 [2001:888:2000:d::a6]:41375 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90334 On Mon, May 11, 2015 at 12:12 PM, Rustom Mody wrote: > On Monday, May 11, 2015 at 7:23:44 AM UTC+5:30, Chris Angelico wrote: >> And I still don't see how this has anything to do with your confusion >> about shadowing the name 'int'. > > Speaking as a compiler-writer -- everything :-) > > In C 'int' is tagged off as different from 'myvar' earlier than say > 'myvar' is different from 'printf'. The "define" in "#define" even earlier > > Python sure has different rules of such 'tagging-off' > However all programming languages are the same in that you cant 'do semantics' > until you have finished 'doing syntax' > And name resolution is in a fuzzy area between the two -- > Ask a theoretician about 'type-checking' and you will hear: "This is just > context-sensitive syntax" > Ask a compiler-writer and you get: "Part of the semantic analysis module" Right, I understand that 'int' may be a keyword... but that would mean it's impossible to run the OP's code anyway. If "class int(str): pass" works, it can't really do anything other than redefine the name "int" to indicate a null subclass of "str" - or is there something else I've missed? ChrisA