Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'static': 0.04; 'that?': 0.05; 'compiler': 0.07; 'stops': 0.07; 'strict': 0.07; 'builtin': 0.09; 'hiding': 0.09; 'override': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'thread': 0.14; 'attributes,': 0.16; 'checking,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'governed': 0.16; 'here"': 0.16; 'namespace,': 0.16; 'python",': 0.16; 'restriction,': 0.16; 'essential': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'library': 0.18; 'passing': 0.19; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; 'you?': 0.31; 'piece': 0.31; 'prevention': 0.31; 'restricted': 0.31; 'anyone': 0.31; 'languages': 0.32; 'actual': 0.34; 'common': 0.35; 'usual': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'changing': 0.37; 'wrong': 0.37; 'ahead': 0.38; 'skip:u 10': 0.60; 'then,': 0.60; 'upgrading': 0.60; 'wonderful': 0.60; 'break': 0.61; 'new': 0.61; "you're": 0.61; 'such': 0.63; 'more': 0.64; 'within': 0.65; 'nobody': 0.68; 'fact,': 0.69; 'as:': 0.81; '2015': 0.84; 'etc,': 0.84; 'mindset': 0.84; 'understand,': 0.84; 'zen': 0.84; 'discovering': 0.91; 'here."': 0.91; 'notion': 0.91; '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=xFq4p3Q5nbuq3ppkAOD+T1rWGT6JAi7pToihSmUbRgA=; b=N1mMj5SVgmomQ3eqVabTbvkP3ZiwulIvKbHKXus00U8XrovHasi8IQnDYEd1iQ0155 CuLbbvmBGYdAHM+7zvrzpFtEc0i2EEqgl8XxCIduLYAGvNQ1sf0bWbCYe4/GiRTSQtPF OJu9LyJPP4Dsz4MFptBNlAsRlnUGYZcY7apSjS7Qa2SbOsEDmecpFMa1m4hxnyQ2qx9E Fo9SPHaBAJfg6kB48NAfIlhJMffKnfsdap4V8+ROExhmtOIqLOZyZi5E5KAEoxjj7EDm 0FKL8JIYfWDzjlbwQnWban3/hm+OnKbjy9zB5rWa/UwhqQkXB7+YsINuC2xxRbVks9Du Fang== MIME-Version: 1.0 X-Received: by 10.107.16.32 with SMTP id y32mr11074755ioi.53.1431330271229; Mon, 11 May 2015 00:44:31 -0700 (PDT) In-Reply-To: References: <554F9525.5040101@digipen.edu> Date: Mon, 11 May 2015 17:44:31 +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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431330279 news.xs4all.nl 2946 [2001:888:2000:d::a6]:34361 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90357 On Mon, May 11, 2015 at 5:12 AM, boB Stepp wrote: >> Common Python thought:: "We're all adults here." If you want to override >> a builtin within your own namespace, who are we to stop you? > > I'm surprised that this thought has not been added to the "Zen Of > Python", as I see it as more and more recurrent as I continue my > studies. What I would like to comprehend is what is the essential > mindset of Python? That is, what do I need to understand, so that I am > no longer likely to be surprised by discovering new possibilities in > Python such as what the current thread is discussing? The Zen of Python is a static document, a historical artifact of a sort. But in terms of understanding the philosophy of Python, "we're all adults here" is a big part of it. Once you grok the notion that nothing can be prevented, you're freed from such considerations as: * Obfuscating, encrypting, or otherwise hiding your source code * Private members with restricted access * Strict type checking, to prevent someone passing in a wrong piece of data * Prevention of monkey-patching etc, etc, etc. In actual fact, anyone can bypass any restriction, in any language; and Python is just more open/honest about it than languages like C++; for instance, instead of having true private members where the compiler stops you from looking at or changing them, Python gives you single-underscore-named attributes, where nobody stops you from doing anything, but there's a general understanding that they're not governed by the usual compatibility rules, so upgrading a library might break your code. Happy with that? Go ahead then, use the internals. Hakuna matata, what a wonderful phrase. ChrisA