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


Groups > comp.lang.python > #51487

Re: import syntax

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'importing': 0.05; 'sys': 0.07; 'collier': 0.09; 'exit': 0.09; 'recommends': 0.09; 'cc:addr :python-list': 0.11; '-tkc': 0.16; 'cleanly': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'pep8': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'import': 0.22; 'cc:addr:python.org': 0.22; 'tend': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'sort': 0.25; 'this:': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'code': 0.31; 'everywhere': 0.31; 'os,': 0.31; 'johnson': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; "i'll": 0.36; 'list': 0.37; 'pm,': 0.38; 'read': 0.60; 'dave': 0.60; 'reach': 0.63; 'more': 0.64; 'further,': 0.74; 'comment.': 0.84; 'received:50.22': 0.84; 'angel': 0.91
Date Mon, 29 Jul 2013 15:20:51 -0500
From Tim Chase <python.list@tim.thechases.com>
To Dave Angel <davea@davea.name>
Subject Re: import syntax
In-Reply-To <kt6i57$2ku$1@ger.gmane.org>
References <51F6C720.2020404@Gmail.com> <kt6i57$2ku$1@ger.gmane.org>
X-Mailer Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - boston.accountservergroup.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - tim.thechases.com
X-Get-Message-Sender-Via boston.accountservergroup.com: none
Cc python-list@python.org
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.5263.1375129166.3114.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375129166 news.xs4all.nl 15966 [2001:888:2000:d::a6]:53271
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51487

Show key headers only | View raw


On 2013-07-29 16:09, Dave Angel wrote:
> On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote:
> > The PEP8 recommends importing like this:
> >
> > import os
> > import re
> >
> > not like this:
> >
> > import os, re
>
> I got a bit further, and if I'm only using a couple of functions
> from the import, I'll list them in the comment.

If I just plan to use a small subset, I tend to reach for the

  from sys import stdout, stderr, exit

sort of syntax.  I find it makes my code read a bit more cleanly than
having to type "sys.stderr.write(...)" everywhere but is still pretty
readable.

-tkc

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


Thread

Re: import syntax Tim Chase <python.list@tim.thechases.com> - 2013-07-29 15:20 -0500

csiph-web