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


Groups > comp.lang.python > #81263

Re: PyWart: "Python's import statement and the history of external dependencies"

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; '21,': 0.07; 'explicit': 0.07; 'sys': 0.07; '22,': 0.09; 'friday,': 0.09; 'method,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'chris,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lying.': 0.16; 'path.': 0.16; 'resolutions,': 0.16; 'subject:dependencies': 0.16; 'subject:import': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'module': 0.19; 'mechanism': 0.19; 'work,': 0.20; 'import': 0.22; 'proposed': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'posts': 0.26; 'suggested': 0.26; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'chris': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'reply.': 0.31; 'file': 0.32; 'cases': 0.33; 'subject:the': 0.34; 'something': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'words,': 0.36; 'method': 0.36; 'should': 0.36; 'nov': 0.38; 'pm,': 0.38; 'explain': 0.39; 'realize': 0.39; 'use.': 0.39; 'either': 0.39; 'read': 0.60; 'subject:"': 0.60; 'most': 0.60; 'new': 0.61; 'advanced': 0.63; 'name': 0.63; 'more': 0.64; 'taking': 0.65; 'techniques': 0.66; 'between': 0.67; "today's": 0.70; 'day': 0.76; 'heavy': 0.81; 'itself?': 0.84; 'situations,': 0.84; 'subject:history': 0.84; 'to:none': 0.92; 'rick': 0.93
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=YmsU4A86oymZNx4ahKb3Ly83C3oNy2sqEzrBwdb2j5A=; b=uG55d82u3LL5CORp+owoflTLCGjAmz0dgtMH4uKWVU7cilj9UyikjSTJft4Rl1prxf AcLHeq/cyab3IXKJmr+6sNA46gtjPZBdjZM3o9UtEGFvMxO9hCWLBCL0agNny/jGuZrW w7KLKaDncovVK4Qt7oczCX+V4aH15Cn/DDZ6IXUeNVvPS/TN7jUN1wrxyxYwXiXFxejP il97PFM9+LZE6qmWTlnLIB7j1H3LFFdaItx+FATrwyMS5fK/fPKVspCtD4k1Mc/O+/7M a0pziKGaEHaghwWaZeHj/hxIWawfNOZtD2aROFFfR5f94AxaKzI5uuIeNjMrnZJYi2Fn hMhA==
MIME-Version 1.0
X-Received by 10.50.171.193 with SMTP id aw1mr1430075igc.2.1416623797018; Fri, 21 Nov 2014 18:36:37 -0800 (PST)
In-Reply-To <2664ed2e-ec79-4cbf-908b-ce91aaa75d3d@googlegroups.com>
References <066c46c8-a04d-4489-b15a-b603c1b1818b@googlegroups.com> <m4m04r$aeg$1@dont-email.me> <8661e407-4472-4208-97c2-f666f6502c67@googlegroups.com> <mailman.16104.1416584077.18130.python-list@python.org> <0bbe1c60-2b29-40f6-96e1-ac777f0c276f@googlegroups.com> <mailman.16121.1416597880.18130.python-list@python.org> <08867178-abb6-4703-9ac5-2a53acb5d227@googlegroups.com> <a2184638-9fd0-4988-8528-cace9786041f@googlegroups.com> <mailman.16127.1416614372.18130.python-list@python.org> <2664ed2e-ec79-4cbf-908b-ce91aaa75d3d@googlegroups.com>
Date Sat, 22 Nov 2014 13:36:36 +1100
Subject Re: PyWart: "Python's import statement and the history of external dependencies"
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16132.1416623800.18130.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416623800 news.xs4all.nl 2849 [2001:888:2000:d::a6]:44663
X-Complaints-To abuse@xs4all.nl
X-Received-Body-CRC 2576115556
X-Received-Bytes 5719
Xref csiph.com comp.lang.python:81263

Show key headers only | View raw


On Sat, Nov 22, 2014 at 12:07 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> On Friday, November 21, 2014 5:59:44 PM UTC-6, Chris Angelico wrote:
>> On Sat, Nov 22, 2014 at 10:21 AM, Rick Johnson
>> <rantingrickjohnson@gmail.com> wrote:
>> > 1. Use the historical "implicit import" mechanism for most day
>> > to day imports, and let Python do all the heavy lifting.
>> >
>> > 2. Use the new "explicit import" mechanism for advanced name
>> > resolutions, but realize that since you are now taking
>> > control of import, so you must do more work, and you must be
>> > "exhaustively explicit" about *where* Python searches.
>>
>> In other words, what you want is:
>>
>> # today's method, import based on search path
>> import sys
>> # new explicit path method
>> import '/usr/local/lib/python3.5/lib-dynload/math.cpython-35m.so'
>>
>> [...]
>>
>> There are a VERY VERY few cases where you really do want
>> to import a module from a specific file path. For those
>> situations, there are already techniques you can use. Why
>> change the behaviour of import itself?
>
> Chris, either take the time to read and understand my posts
> *FULLY*, or don't bother to reply. I have in no way
> suggested that we import via "filepaths". Stop lying.

Okay. Explain to me the difference between your proposed "explicit
import" mechanism, where you specifically name the path where Python
should import something from, and "importing via filepaths".

ChrisA

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


Thread

PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-15 21:01 -0800
  Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-16 16:16 +1100
  Re: PyWart: "Python's import statement and the history of external dependencies" alex23 <wuwei23@gmail.com> - 2014-11-21 10:14 +1000
    Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-21 11:31 +1100
    Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-20 19:53 -0800
      Re: PyWart: "Python's import statement and the history of external dependencies" Tim Chase <python.list@tim.thechases.com> - 2014-11-21 04:26 -0600
        Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 07:52 -0800
          Re: PyWart: "Python's import statement and the history of external dependencies" Tim Chase <python.list@tim.thechases.com> - 2014-11-21 10:12 -0600
          Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 10:42 -0700
      Re: PyWart: "Python's import statement and the history of external dependencies" Ned Batchelder <ned@nedbatchelder.com> - 2014-11-21 06:32 -0500
      Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 08:33 -0700
        Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 10:24 -0800
          Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-22 05:34 +1100
          Re: PyWart: "Python's import statement and the history of external dependencies" Michael Torrie <torriem@gmail.com> - 2014-11-21 12:05 -0700
            Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 12:29 -0800
              Re: PyWart: "Python's import statement and the history of external dependencies" Michael Torrie <torriem@gmail.com> - 2014-11-21 15:54 -0700
          Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 12:23 -0700
            Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 14:25 -0800
              Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 15:21 -0800
                Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-22 10:52 +1100
                Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 17:07 -0800
                Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-22 13:36 +1100
                Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-22 02:27 -0700
                Re: PyWart: "Python's import statement and the history of external dependencies" sohcahtoa82@gmail.com - 2014-11-21 16:33 -0800
                Import a module from a specific file path (was: PyWart: "Python's import statement and the history of external dependencies") Ben Finney <ben+python@benfinney.id.au> - 2014-11-22 11:37 +1100
                Re: Import a module from a specific file path Marko Rauhamaa <marko@pacujo.net> - 2014-11-22 08:28 +0200
                Re: Import a module from a specific file path (was: PyWart: "Python's import statement and the history of external dependencies") Chris Angelico <rosuav@gmail.com> - 2014-11-22 13:32 +1100
                Re: Import a module from a specific file path Ben Finney <ben+python@benfinney.id.au> - 2014-11-22 17:46 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-21 17:32 -0700
                Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-21 17:48 -0800
          Re: PyWart: "Python's import statement and the history of external dependencies" Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-21 15:38 -0500
        Re: PyWart: "Python's import statement and the history of external dependencies" Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-22 23:25 +1100
          Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-23 00:00 +1100
            Re: PyWart: "Python's import statement and the history of external dependencies" Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-23 17:30 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Rustom Mody <rustompmody@gmail.com> - 2014-11-22 22:44 -0800
              Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-23 17:56 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-23 17:59 +1100
                Re: PyWart: "Python's import statement and the history of external   dependencies" Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-11-24 11:37 +1300
                Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-23 22:25 -0800
                Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-24 17:34 +1100
                Re: PyWart: "Python's import statement and the history of external dependencies" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-24 10:34 +0000
                Re: PyWart: "Python's import statement and the history of external dependencies" Rick Johnson <rantingrickjohnson@gmail.com> - 2014-11-24 08:51 -0800
                Re: PyWart: "Python's import statement and the history of external dependencies" Ned Batchelder <ned@nedbatchelder.com> - 2014-11-24 12:06 -0500
                Re: PyWart: "Python's import statement and the history of external dependencies" Robin Becker <robin@reportlab.com> - 2014-11-24 17:07 +0000
                Re: PyWart: "Python's import statement and the history of external dependencies" Marko Rauhamaa <marko@pacujo.net> - 2014-11-24 19:08 +0200
                Re: PyWart: "Python's import statement and the history of external dependencies" Rustom Mody <rustompmody@gmail.com> - 2014-11-24 09:38 -0800
                Re: PyWart: "Python's import statement and the history of external dependencies" Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-24 15:34 -0700
              Re: PyWart: "Python's import statement and the history of external dependencies" Ben Finney <ben+python@benfinney.id.au> - 2014-11-23 18:43 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-23 18:51 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-23 11:23 -0500
              Re: PyWart: "Python's import statement and the history of external dependencies" Chris Angelico <rosuav@gmail.com> - 2014-11-24 03:36 +1100
          Re: PyWart: "Python's import statement and the history of external dependencies" Tim Chase <python.list@tim.thechases.com> - 2014-11-22 15:27 -0600
            Re: PyWart: "Python's import statement and the history of external dependencies" Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-23 12:00 +1100
              Re: PyWart: "Python's import statement and the history of external dependencies" Tim Chase <python.list@tim.thechases.com> - 2014-11-22 19:33 -0600

csiph-web