I must be an idiot, please pity me!
sam at localhost.localdomain
Thu Sep 12 00:55:46 CEST 2002
Perhaps I wasn't clear, but I don't believe I mentioned anything not
functioning properly. I did say "All works fine". I don't have failing
code, I simply suspect (hope) the current implentation isn't very good.
The pseudo code listed was what I was epecting python to allow me to do,
but due to the namespace implementation, it doesn't. I have to do what I
considered as a work around, and that is by passing a db connection to
pretty much everything to get seperate modules/functions to share a db
connection. Maybe that's just the way things are done in python, modules
and databases? I don't know, that's why I'm asking.
Putting everything into one module works as expected too. But then it's
not very good for code reusage, as importing that module brings me back to
passing a db connection to everything.
I was hoping that I had missunderstood a basic concept, and that there was
a nice way of perform something along the lines of the pseudo code listed.
On Wed, 11 Sep 2002 18:10:42 +0100, Mark McEahern wrote:
>> But it doesn't seem to work like that.
> I don't know about all the mind readers out there, but you really
> haven't given us any helpful information. Are you getting an error?
> What are the symptoms of failure? What are you expecting to happen? Why
> not try to simplify what it is you're trying to do and share *that*
> For instance, the functions in each of your modules--do they take a
> database connection as a parameter?
> Have you tried stuffing everything into one module--just to see if it
> // m
More information about the Python-list