Re: Beautiful Python

2005-12-28 Thread John J. Lee
[EMAIL PROTECTED] writes: [...] > > Sometimes putting import statements at the beginning is not feasible > > (i.e. only when some condition has been met), as importing has some > > impact on program execution (importing executes code in imported > > module). This does not resemble Java imports (I d

Re: Beautiful Python

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 21:35:46 -0600, news wrote: >> Sometimes putting import statements at the beginning is not feasible >> (i.e. only when some condition has been met), as importing has some >> impact on program execution (importing executes code in imported >> module). This does not resemble Java

Re: Beautiful Python

2005-12-27 Thread news
In article <[EMAIL PROTECTED]>, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Gekitsuu napisal(a): > > > use strict; > > use WWW::Mechanize; > > use CGI; > > > > This seems to be the de facto standard in the Perl community but in > > python it seems most of the code I look at has import statements >

Re: Beautiful Python

2005-12-27 Thread Peter Decker
On 27 Dec 2005 10:02:17 -0800, Gekitsuu <[EMAIL PROTECTED]> wrote: > My > hypothetical situation was as follows. I'm writing a new generic SQL > module and I want to make it so I only call the appropriate module for > the type of SQL server I'm talking to. Then it would make sense to > load, for in

Re: Beautiful Python

2005-12-27 Thread Fredrik Lundh
"Gekitsuu" wrote: > That is part of what I was asking but I was also hoping to hear the > common wisdom so to speak. When I posted I had considered the idea for > a bit and the situations people have mentioned were similar to the > scenario I came up with as a good time to break such a rule. My >

Re: Beautiful Python

2005-12-27 Thread Gekitsuu
That is part of what I was asking but I was also hoping to hear the common wisdom so to speak. When I posted I had considered the idea for a bit and the situations people have mentioned were similar to the scenario I came up with as a good time to break such a rule. My hypothetical situation was as

Re: Beautiful Python

2005-12-26 Thread rbt
[EMAIL PROTECTED] wrote: > Gekitsuu wrote: >> I've been reading a lot of python modules lately to see how they work >> and I've stumbled across something that's sort of annoying and wanted >> to find out of there was a good reason behind it. In a Perl program >> when you're calling other modules yo

Re: Beautiful Python

2005-12-26 Thread sconce
Gekitsuu wrote: > I've been reading a lot of python modules lately to see how they work > and I've stumbled across something that's sort of annoying and wanted > to find out of there was a good reason behind it. In a Perl program > when you're calling other modules you'll add "use" statements at th

Re: Beautiful Python

2005-12-26 Thread Chip Turner
On 2005-12-26 05:01:07 -0500, "Gekitsuu" <[EMAIL PROTECTED]> said: > I've been reading a lot of python modules lately to see how they work > and I've stumbled across something that's sort of annoying and wanted > to find out of there was a good reason behind it. In a Perl program > when you're cal

Re: Beautiful Python

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 02:01:07 -0800, Gekitsuu wrote: > Is there a sound reason for putting the imports > there are are developers just loading modules in as they need them. I > own Damian Conway's book of Perl Best Practices and it seems from a > maintainability standpoint that having all the modu

Re: Beautiful Python

2005-12-26 Thread Jarek Zgoda
Gekitsuu napisal(a): > use strict; > use WWW::Mechanize; > use CGI; > > This seems to be the de facto standard in the Perl community but in > python it seems most of the code I look at has import statements > everywhere in the code. Is there a sound reason for putting the imports > there are are