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


Groups > comp.lang.python > #38429

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

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'function,': 0.07; 'builtins': 0.09; 'imported': 0.09; 'len,': 0.09; 'namespace': 0.09; 'repr': 0.09; 'properly': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic.': 0.16; 'merely': 0.16; 'namespace.': 0.16; 'wrote:': 0.17; 'saying': 0.18; 'feb': 0.19; 'module': 0.19; 'import': 0.21; 'purposes': 0.23; 'header:In- Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'fri,': 0.30; '(2)': 0.32; 'johnson': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; '(1)': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'serve': 0.36; 'but': 0.36; 'does': 0.37; 'level': 0.37; 'two': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'your': 0.60; 'side': 0.61; '2013': 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=rZKGigpwwg/paE45XYTbC0p7qxbg3Lu8wPoXYbDNVuQ=; b=yNWSU/PQn9ixxs6x4InRwapvFBEgL7RwvoGp/8QemmO9LXZnCDYhvOHmLkfGuTTRP/ 28CZTeamG/VR5BZcp07RxMxMzZoCv7f+/YLFdP+Nd+3Rq0s0SXtvUfSc+4oEDv1wZM6p 2QsAkZhHW1CPkIlbC882cu4fqt4Epj6d8nux6vdIaZu8U9IElWMdJyQzh4OPHHclO6nP yN/U9JIKzY3Ptq1WZeIvBvftFR2BH/hvuIZG9iUeUMajpJDoBwKMLa4qhzXr+yQkiUUe GiPFwmRaTAWD/4uzOXXaH4RD/YksFAMJHxksvFbyU3tNeSdm6Dd3u2zhacUv4HXRF1kS YPVA==
MIME-Version 1.0
X-Received by 10.58.12.200 with SMTP id a8mr5351232vec.52.1360308498891; Thu, 07 Feb 2013 23:28:18 -0800 (PST)
In-Reply-To <9718523e-12dc-4228-8879-27965b7b3d30@googlegroups.com>
References <02ced8e2-5967-4ce0-b257-83c3a3fbaf8e@googlegroups.com> <mailman.1484.1360304743.2939.python-list@python.org> <9718523e-12dc-4228-8879-27965b7b3d30@googlegroups.com>
Date Fri, 8 Feb 2013 18:28:18 +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.1491.1360308501.2939.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360308501 news.xs4all.nl 6881 [2001:888:2000:d::a6]:47349
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38429

Show key headers only | View raw


On Fri, Feb 8, 2013 at 6:23 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
>      from builtins import print, len, repr
>      from builtins import *  # This is not recommended!
>
> This would serve two purposes (1) the reader would know which builtins where being used in this module (2) the names would be bound properly to the module namespace. But this does not answer your question, merely a side note
>
> So your assertion is wrong. Built-ins /would/ be available at the module level with no qualification just as they are now. But they would also be available in /every/ namespace because how else would we use them Chris?

So what you're saying is that builtins are available without
qualification inside a function, but other names imported into the
module namespace aren't? MAGIC.

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