Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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; "subject:' ": 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'os.path': 0.09; 'subject:modules': 0.09; '~ethan~': 0.09; 'subject:question': 0.10; 'filename:fname piece:signature': 0.16; 'wrote:': 0.18; 'code,': 0.22; 'import': 0.22; 'header:User- Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'front': 0.32; 'subject:from': 0.34; 'could': 0.34; 'charset:us-ascii': 0.36; 'throughout': 0.37; 'to:addr:python- list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:173': 0.61; 'refer': 0.63; 'etc,': 0.84 Date: Thu, 04 Dec 2014 10:02:54 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Style question: Importing modules from packages - 'from' vs 'as' References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DND46AGt2KNTV8h0C0GH981VdkMHgFNHk" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417716210 news.xs4all.nl 2877 [2001:888:2000:d::a6]:46258 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 2098289466 X-Received-Bytes: 4201 Xref: csiph.com comp.lang.python:81926 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DND46AGt2KNTV8h0C0GH981VdkMHgFNHk Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 12/03/2014 03:02 AM, Chris Angelico wrote: >=20 > Throughout the code, I want to refer to "path.split()", > "path.isfile()", etc, without the "os." in front of them. I could do > either of these: >=20 > import os.path as path > from os import path >=20 > Which one would you recommend? Does it depend on context? I recommend the one with less typing. ;) -- ~Ethan~ --DND46AGt2KNTV8h0C0GH981VdkMHgFNHk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJUgKHOAAoJENZ7D1rrH75NN2wP/ja6xdOFBpy6xGWLndW/UT/d 8sxzGUPIZEH9NtYXmrcwVBtYT53hkCQ++rY/6s8zowt442UGd4QvwCDnjKPdXcqZ fWOPOZ+theGlGrpexRy3Jk3ath2u9qF0t4WCfIX9Y2vugfT7NFAaghuFD9rkVew2 aMsEVRDu8hdQvQLM73vjQq63vtvbjr8eVwBtgI2CnYtJbtw+1efzfB5JLKy2u2SB LZ+xei2Fgi9po0cvEueNs1G7N1PQaZAEr3Q/McABx04NpbQbod9alfq63jPKCZ0x cU7NCZ6f+tOi9m3fdfjMeyynHb9Xd3Z6Wi+U1rh2+MOsg0jcaBmgrcrNiHwwOcAc VtHk9a+aCWDjzBRv767EI2RoPvJiOe0BeNl808EAYInz4G2+AbqlKaACDxbMhg8q Vbh7iVRgQXI2eBXlqsq0X/HlZt6yoafI8B7Er+2vR0LzqskvkbS2bU4CzbVbjohM okkOoZBYHLlLUyPXpaFOhLNZtz7XsDKEYB4lh1UsPiUgPWtIEWXfm7dBbhc3KDdS V46MLCn+Lbn+2sMpFoyOZLO6FVsisgwx8eeOP2Pa4QL6OJMSeOQtXAQF5HaS6Kx2 n4FgxivnCWwk1eEudwwW1jSshEjBPaistlq1OuCOKgsRf2WNvmg/D7wNc/5BMwo7 RjNkseTV+n12a5NZmmjh =lmhP -----END PGP SIGNATURE----- --DND46AGt2KNTV8h0C0GH981VdkMHgFNHk--