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


Groups > comp.lang.python > #81340

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!newsfeed3a.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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'subject:Python': 0.06; '(using': 0.07; 'correct.': 0.07; 'explicit': 0.07; 'paths': 0.07; '*is*': 0.09; 'already.': 0.09; 'bash': 0.09; 'feature,': 0.09; 'interpreted': 0.09; 'sure,': 0.09; 'wrong,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'language,': 0.12; "wouldn't": 0.14; '23,': 0.16; '3.3,': 0.16; '5:30': 0.16; 'bash,': 0.16; 'brilliant': 0.16; 'does,': 0.16; 'exist.': 0.16; 'fork': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'haskell,': 0.16; 'hint:': 0.16; 'massively': 0.16; 'naming': 0.16; 'paths.': 0.16; 'problems!': 0.16; 'subject:dependencies': 0.16; 'subject:import': 0.16; 'java,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'bit': 0.19; 'properly': 0.19; "skip:' 30": 0.19; '>>>': 0.22; 'programming': 0.22; 'import': 0.22; 'putting': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'certainly': 0.24; 'module,': 0.24; 'unicode': 0.24; 'cc:2**0': 0.24; 'compiled': 0.26; 'first,': 0.26; 'right.': 0.26; 'this:': 0.26; 'world,': 0.26; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'chris': 0.29; "doesn't": 0.30; 'designer': 0.30; 'see,': 0.30; 'message- id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; "i'm": 0.30; 'usually': 0.31; '(maybe': 0.31; 'accidentally': 0.31; 'agreed.': 0.31; 'are.': 0.31; "d'aprano": 0.31; 'go.': 0.31; 'implicit': 0.31; 'obscure': 0.31; 'pascal': 0.31; 'steven': 0.31; 'file': 0.32; 'there.': 0.32; 'languages': 0.32; 'running': 0.33; 'alone': 0.33; 'beginning': 0.33; 'actual': 0.34; 'maybe': 0.34; 'subject:the': 0.34; 'could': 0.34; 'common': 0.35; 'except': 0.35; 'something': 0.35; 'etc': 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'himself': 0.36; "didn't": 0.36; 'useful': 0.36; 'possible': 0.36; 'should': 0.36; 'wrong': 0.37; 'so,': 0.37; 'being': 0.38; 'system,': 0.38; 'nov': 0.38; 'skip:[ 10': 0.38; 'pm,': 0.38; 'though,': 0.39; 'either': 0.39; 'easy': 0.60; 'subject:"': 0.60; 'most': 0.60; "you're": 0.61; 'making': 0.63; 'guarantee': 0.63; 'show': 0.63; 'name': 0.63; 'pick': 0.64; 'more': 0.64; 'world': 0.66; 'here': 0.66; 'production': 0.68; 'therefore': 0.72; 'special': 0.74; "else's": 0.84; 'nice,': 0.84; 'shadow': 0.84; 'subject:history': 0.84; 'inefficient': 0.91; '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=jvCj2c2Z1BF+16KpifLGkLD40YNbeKuzVQYlLD9/Prk=; b=kOrkiDo0jcVtAv0/DILTgaGaV8HGXQp/eTpeVISn5S8NetMaj/D+e7gbPfNQM6yGOk ngdZCkSYWy4OdudznFHXOzfeM4Wx2wANcJt2xmWthLefcBTjUSbhL1IqJg9DwjJ6qF9y FgM7btC34lFu82D+UOB5mtSB6Si9jNWpqt4ZOoWqPbamB6BZ2x0pSZOYEZ5eGHBuzyyk 3d4oMoxM9EykWP6YbhHdL1N/k4a+BkqvHihIRVDBvdKD8/31zU0TeApIVJIl6NeZCbPp P8t2+9Ky3NMe/DrkjFb4qFDOTEN3RDPwaZqV0eSgFqrR2ytRYH3wiLwpAL6u0ZeuPFSE xHCA==
MIME-Version 1.0
X-Received by 10.50.79.135 with SMTP id j7mr6070248igx.14.1416725778752; Sat, 22 Nov 2014 22:56:18 -0800 (PST)
In-Reply-To <54717eeb$0$12992$c3e8da3$5496439d@news.astraweb.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> <547080a0$0$12981$c3e8da3$5496439d@news.astraweb.com> <mailman.16139.1416661237.18130.python-list@python.org> <54717eeb$0$12992$c3e8da3$5496439d@news.astraweb.com>
Date Sun, 23 Nov 2014 17:56:18 +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.16164.1416725780.18130.python-list@python.org> (permalink)
Lines 73
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416725780 news.xs4all.nl 2860 [2001:888:2000:d::a6]:44719
X-Complaints-To abuse@xs4all.nl
X-Received-Body-CRC 870483297
X-Received-Bytes 8269
Xref csiph.com comp.lang.python:81340

Show key headers only | View raw


On Sun, Nov 23, 2014 at 5:30 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Chris Angelico wrote:
>
>> Okay, here's my guesses.
>>
>> os2emxpath: In the stdlib, but more often accessed as "os.path" while
>> running under OS/2
>
> Correct.

I'm in a special position here, as I actually have an OS/2 system, and
have used Python on it. So I know about the particular obscure system
that you happened to pick there. Now, if you'd said "amigapath", I
wouldn't have known.

> [chomp a few correct and a few wrong, here and there]
>
> Not bad, but as you can see, the naming convensions are all over the place.
> It's easy to accidentally shadow the std lib.

Agreed. There's no way to guarantee that you aren't shadowing someone
else's module, except by namespacing your own - either putting your
name at the beginning of every file name ("fredfoobar_calendar") or by
making a package ("fredfoobar.calendar").

It would be nice, though, to be able to *detect* shadowing. Is there a
way (maybe through importlib) to ask Python to enumerate every file
that could be found when attempting to "import calendar"? Something
like this:

>>> import importlib
>>> importlib.find_all_modules("calendar")
['calendar.py', '/usr/local/lib/python3.5/calendar.py']

That would be a useful feature, if it doesn't already exist. If it
does, it could do with a bit more visibility - poking around on Google
and interactively with help(importlib) etc didn't reveal it to me.

>> That's what Rick said first, and then said that if you're going to be
>> explicit, you should do the job properly and not have _any_ implicit
>> paths.
>
> Rick should ask himself why virtually every single language, from compiled
> languages like Ada, C, Pascal and Java, to interpreted languages like bash,
> all use search paths instead of explicit paths.
>
> Hint: the answer is not that every single language designer in the world is
> a moron.

Maybe they are. Maybe Rick's just so amazingly brilliant that he,
alone among all language designers, has figured this out. Maybe it's
time for his fork of Python to sweep the world with its incredible
solutions to massively prevalent problems!

While it *is* possible for every language in the world to get
something wrong, there's usually a few around the place that get it
right. Until Python 3.3, most popular languages got Unicode support
either wrong (using UTF-16 being the most common wrongness) or
inefficient (using UTF-32), or just didn't have any at all (bytes
everywhere). Could someone look at the state of world programming
languages and say "Everyone uses UTF-16, and not every language
designer in the world is a moron, therefore UTF-16 must be the right
thing to do"? No, because Haskell, Scheme, Pike, and bash all had it
right, already. Sure, they're not the most-used languages in the
world, but they certainly are used (bash plenty, though to be honest,
not many people use bash scripts for Unicode heavy-lifting), and they
prove that UTF-16 isn't the only way to go.

So, where are the languages that use explicit paths? Show us why
they're so great, using actual production code.

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