Re: Advice on the style to use in imports

2008-08-30 Thread Bruno Desthuilliers
Marco Bizzarri a écrit : Hi all. I read the PEP8 and the "importing Python Modules" article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your advices on how I should change them. The

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 4:53 PM, Eric Wertman <[EMAIL PROTECTED]> wrote: >> I read the PEP8 and the "importing Python Modules" article. However, >> I'm still a little confused on what should the general rules for >> importing modules. >> >> I'm showing what I used in my current project, and will ac

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
Hi bearophile On Sat, Aug 30, 2008 at 4:04 PM, <[EMAIL PROTECTED]> wrote: > > from somemodule import somename > > is often acceptable IHMO, but there are some things to consider: > - you and the person that reads your code have to remember where > somename comes from. So you can do it for well

Re: Advice on the style to use in imports

2008-08-30 Thread Eric Wertman
> I read the PEP8 and the "importing Python Modules" article. However, > I'm still a little confused on what should the general rules for > importing modules. > > I'm showing what I used in my current project, and will accept your > advices on how I should change them. > import module > > and then

Re: Advice on the style to use in imports

2008-08-30 Thread bearophileHUGS
Marco Bizzarri: > I'm just confused because PEP8 seems to suggest that the from module > import Class style is acceptable; is there a big "if you know what are > doing" before, which I'm unable to see? from somemodule import somename is often acceptable IHMO, but there are some things to consider

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
On Sat, Aug 30, 2008 at 2:20 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > importing objects instead of the module (namespace) they live in can cause > all sorts of aliasing and dependency issues. avoid unless you know exactly > what you're doing. > > > Thanks Fredrik; I understand that is th

Re: Advice on the style to use in imports

2008-08-30 Thread Fredrik Lundh
Marco Bizzarri wrote: I'm showing what I used in my current project, and will accept your advices on how I should change them. The style is consistently the following: from package.subpackge.module import MyClass Is this an accepted way to write imports? According to what I understood in arti

Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
Hi all. I read the PEP8 and the "importing Python Modules" article. However, I'm still a little confused on what should the general rules for importing modules. I'm showing what I used in my current project, and will accept your advices on how I should change them. The style is consistently the