A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-February/019758.html below:

[Python-Dev] Re: opcode performance measurements

[Python-Dev] Re: opcode performance measurements [Python-Dev] Re: opcode performance measurementsGordon McMillan gmcm@hypernet.com
Thu, 31 Jan 2002 19:51:50 -0500
On 31 Jan 2002 at 6:12, Jeremy Hylton wrote:

> import mod.sub
> creates a binding for "mod" in the global namespace
> 
> The compiler can detect that the import statement is
> a package import -- and mark "mod.sub" as a
> candidate for optimization.  A use of "mod.sub.attr"
> in function should be treated just as "mod.attr". 

How can the compiler tell it's a package import?

It's bad practice, but people write "import mod.attr" all the time. Heck, Marc-Andre tricks import so that pkg.mod is really pkg.attr where the attr turns into a 
mod when accessed. No problem, since it's only import that cares what it is. By the time it's used it's always global.attr.attr....

-- Gordon
http://www.mcmillan-inc.com/




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4