Re: [Tutor] Importing sub modules

2011-04-01 Thread Prasad, Ramit
>However the sub-modules co.py and order.py are *not* imported by the >main module. They are only loaded on demand, when you say "import >stats.co" or "from stats.order import median" or similar. >So it depends on the module. That is exactly what I wondering and an excellent example to illustra

Re: [Tutor] Importing sub modules

2011-04-01 Thread Alan Gauld
"bob gailer" wrote On 3/31/2011 1:07 PM, Prasad, Ramit wrote: This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, .

Re: [Tutor] Importing sub modules

2011-03-31 Thread bob gailer
On 3/31/2011 1:07 PM, Prasad, Ramit wrote: This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information

Re: [Tutor] Importing sub modules

2011-03-31 Thread Steven D'Aprano
Prasad, Ramit wrote: In any event, you shouldn't be worrying about something like overhead until after your base prorgram is written. Base programs are written. I was just looking into insight about the mechanics behind importing :) For instance, do these libraries normally lazy load? If you

Re: [Tutor] Importing sub modules

2011-03-31 Thread Steven D'Aprano
Prasad, Ramit wrote: The joins are really just random calls. I was just curious if importing os.path could avoid any reading/overhead that might occur by importing os. No. Python has no way of knowing what os.path is until it has imported os and can do an attribute lookup on os.path. This is

Re: [Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
>> In any event, you shouldn't be worrying about something like overhead until >> after your base prorgram is written. Base programs are written. I was just looking into insight about the mechanics behind importing :) For instance, do these libraries normally lazy load? If you have mod1.mod2 and

Re: [Tutor] Importing sub modules

2011-03-31 Thread eire1130
import. If not I just import the enchilada Sent from my Verizon Wireless BlackBerry -Original Message- From: "Prasad, Ramit" Sender: tutor-bounces+eire1130=gmail@python.org Date: Thu, 31 Mar 2011 17:11:50 To: 'Emile van Sebille'; 'tutor@python.org' Su

Re: [Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
-Original Message- From: tutor-bounces+ramit.prasad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Emile van Sebille Sent: Thursday, March 31, 2011 3:17 PM To: tutor@python.org Subject: Re: [Tutor] Importing sub modules On 3/31/2011 11:07 AM

Re: [Tutor] Importing sub modules

2011-03-31 Thread Emile van Sebille
On 3/31/2011 11:07 AM Prasad, Ramit said... Hi everyone, I was wondering if there is a difference in import os os.path.join(string1,string2) AND import os.path os.path.join(string1,string2) A quick test shows they're the same: ActivePython 2.6.6.15 (ActiveState Software Inc.) based on

[Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
Hi everyone, I was wondering if there is a difference in >>>import os >>>os.path.join(string1,string2) AND >>>import os.path >>>os.path.join(string1,string2) The only difference that I could think of is if the os module does not get loaded on the second example. I am not sure if it does. Ram