Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38442

Re: PyWart: Namespace asinitiy and the folly of the global statement

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.032
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'class,': 0.07; 'builtins': 0.09; 'global,': 0.09; 'globals': 0.09; 'programmer': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiers.': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'examples': 0.18; '>>>': 0.18; 'feb': 0.19; 'module': 0.19; 'variable': 0.20; 'skip:_ 20': 0.22; 'header:In-Reply-To:1': 0.25; 'module.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'block,': 0.29; "d'aprano": 0.29; 'equivalent.': 0.29; 'steven': 0.29; 'things,': 0.29; 'fri,': 0.30; 'johnson': 0.32; 'qualify': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'skip:g 30': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'list,': 0.39; 'skip:" 10': 0.40; 'your': 0.60; 'containing': 0.61; 'skip:a 40': 0.61; 'making': 0.64; 'skip:n 40': 0.72; '2013': 0.84; 'pardon': 0.84; 'qualified:': 0.84; 'say:': 0.84; 'rick': 0.91
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=iREpYnr5ILmLHuww2gq9r2MIWvf2tyVPuwhNr7uh5xM=; b=AEuun6DHlsWGHT8GTSf7c9pofhGJ7hQy6v4SURDhPYJwFTf/Vh6nGDgrR6SmbyowaQ KBgGtbe2LxnW98aRnqZ+gMfTYZF5dRUEJ0IfVImg9He2nyAu9IOMRxJZRTRJr5hHAKuZ rOodZQR11EF9M0FSJOV81ypBcDTmn4rqA8/5v2xN/ZIV4i0j/PIkJrbtR34pA3C6uWd8 kAPP5AdKDE3hl7JgycBWNUgYclphl0AcuQb5yZ7ciwKvb0I+KD/VIeQSqtg2Xp12EUa7 cfPBq41FLnCjFKKnInfkGSoabHAjof3nVnzQDJbYWJc7RnnoRl8V2SKI0AWsyTuEtUwx PnpA==
MIME-Version 1.0
X-Received by 10.58.97.165 with SMTP id eb5mr6231896veb.40.1360323498034; Fri, 08 Feb 2013 03:38:18 -0800 (PST)
In-Reply-To <5114e19a$0$29969$c3e8da3$5496439d@news.astraweb.com>
References <02ced8e2-5967-4ce0-b257-83c3a3fbaf8e@googlegroups.com> <mailman.1484.1360304743.2939.python-list@python.org> <5114e19a$0$29969$c3e8da3$5496439d@news.astraweb.com>
Date Fri, 8 Feb 2013 22:38:17 +1100
Subject Re: PyWart: Namespace asinitiy and the folly of the global statement
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1497.1360323501.2939.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360323501 news.xs4all.nl 6983 [2001:888:2000:d::a6]:51229
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38442

Show key headers only | View raw


On Fri, Feb 8, 2013 at 10:29 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Chris Angelico wrote:
>
>> On Fri, Feb 8, 2013 at 3:30 PM, Rick Johnson
>> <rantingrickjohnson@gmail.com> wrote:
>>> It is my strong opinion that all "unqualified" variables must be local to
>>> the containing block, func/meth, class, or module. To access any variable
>>> outside of the local scope a programmer MUST qualify that variable with
>>> the func, class, or module identifiers. Consider the following examples
>>
>> Okay. Now start actually working with things, instead of just making
>> toys. All your builtins now need to be qualified:
>>
>> __builtins__.print("There
>> are",__builtins__.len(self.some_list),"members in this list,
>> namely:",__builtins__.repr(self.some_list))
>
>
> Pardon me, but since __builtins__ is a global, you have to say:
>
> globals.__builtins__.print("screw this for a game of soldiers")
>
> or equivalent.

And isn't globals a builtin?

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PyWart: Namespace asinitiy and the folly of the global statement Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-07 20:30 -0800
  Re: PyWart: Namespace asinitiy and the folly of the global statement Michael Torrie <torriem@gmail.com> - 2013-02-07 23:21 -0700
  Re: PyWart: Namespace asinitiy and the folly of the global statement Chris Angelico <rosuav@gmail.com> - 2013-02-08 17:25 +1100
    Re: PyWart: Namespace asinitiy and the folly of the global statement Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-07 23:23 -0800
      Re: PyWart: Namespace asinitiy and the folly of the global statement Chris Angelico <rosuav@gmail.com> - 2013-02-08 18:28 +1100
    Re: PyWart: Namespace asinitiy and the folly of the global statement Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-07 23:23 -0800
    Re: PyWart: Namespace asinitiy and the folly of the global statement Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-08 22:29 +1100
      Re: PyWart: Namespace asinitiy and the folly of the global statement Chris Angelico <rosuav@gmail.com> - 2013-02-08 22:38 +1100
  Re: PyWart: Namespace asinitiy and the folly of the global statement Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-08 22:45 +1100
    Re: PyWart: Namespace asinitiy and the folly of the global statement Michael Torrie <torriem@gmail.com> - 2013-02-08 21:25 -0700
      Re: PyWart: Namespace asinitiy and the folly of the global statement alex23 <wuwei23@gmail.com> - 2013-02-10 18:42 -0800
        Re: PyWart: Namespace asinitiy and the folly of the global statement Chris Angelico <rosuav@gmail.com> - 2013-02-11 17:27 +1100
        Re: PyWart: Namespace asinitiy and the folly of the global statement Jason Swails <jason.swails@gmail.com> - 2013-02-11 13:32 -0500
        Re: PyWart: Namespace asinitiy and the folly of the global statement Michael Torrie <torriem@gmail.com> - 2013-02-11 12:15 -0700
        Re: PyWart: Namespace asinitiy and the folly of the global statement Chris Angelico <rosuav@gmail.com> - 2013-02-12 08:11 +1100

csiph-web