>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
"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, .
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
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
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
>> 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
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
-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
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
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
10 matches
Mail list logo