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


Groups > comp.lang.python > #81926 > unrolled thread

Re: Style question: Importing modules from packages - 'from' vs 'as'

Started byEthan Furman <ethan@stoneleaf.us>
First post2014-12-04 10:02 -0800
Last post2014-12-04 10:02 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Style question: Importing modules from packages - 'from' vs 'as' Ethan Furman <ethan@stoneleaf.us> - 2014-12-04 10:02 -0800

#81926 — Re: Style question: Importing modules from packages - 'from' vs 'as'

FromEthan Furman <ethan@stoneleaf.us>
Date2014-12-04 10:02 -0800
SubjectRe: Style question: Importing modules from packages - 'from' vs 'as'
Message-ID<mailman.16572.1417716210.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On 12/03/2014 03:02 AM, Chris Angelico wrote:
> 
> 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:
> 
> import os.path as path
> from os import path
> 
> Which one would you recommend? Does it depend on context?

I recommend the one with less typing.  ;)

--
~Ethan~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web