Re: How to import only one module in a package when the package __init__.py has already imports the modules?

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 22:48:10 -0500, Peng Yu wrote: >> Variables in a function are already private.  How can the names in one >> function be affected by other functions in the same module? > > You misunderstood me. > > If there are multiple functions or classes in a file, when I change > variable

Re: How to import only one module in a package when the package __init__.py has already imports the modules?

2009-10-31 Thread Steven D'Aprano
On Sat, 31 Oct 2009 22:54:47 -0500, Peng Yu wrote: > So python would not be able to accommodate my preference one > class/function per file? Of course it does! You can do that RIGHT NOW -- just put one class per file. > I.e., I have to use something like 'from spam > import spam' or 'spam.spam

Identifiers exposed by a package (was: How to import only one module in a package when the package __init__.py has already imports the modules?)

2009-10-31 Thread Ben Finney
Robert Kern writes: > If you are going to expose symbols in your __init__.py, they should > not have the same name as any of the modules in the package. Would I be correct in assuming you make an exception for the package importing one of the modules in the package, and thereby making that modul

Re: import bug

2009-10-31 Thread Steven D'Aprano
On Sun, 01 Nov 2009 01:38:16 -0300, Gabriel Genellina wrote: >> Incorrect. Simplicity of implementation and API is a virtue, in and of >> itself. The existing module machinery is quite simple to understand, >> use and maintain. > > Uhm... module objects might be quite simple to understand, but mo

Re: Sqlite3. Substitution of names in query.

2009-10-31 Thread Lawrence D'Oliveiro
In message , Carsten Haese wrote: > Lawrence D'Oliveiro wrote: > >> In message , Carsten >> Haese wrote: >> >>> Lawrence D'Oliveiro wrote: >>> In message , Dennis Lee Bieber wrote: > This way regular string interpolation operations (or whatever Python > 3.x has replaced it

Re: Identifiers exposed by a package

2009-10-31 Thread Robert Kern
Ben Finney wrote: Robert Kern writes: If you are going to expose symbols in your __init__.py, they should not have the same name as any of the modules in the package. Would I be correct in assuming you make an exception for the package importing one of the modules in the package, and thereby

<    1   2