I've working with web2py for a little while now (loving it!), and been
poking through a few appliances, especially Instant Press!) to puzzle
out how things work. This is probably a basic Python question, or
maybe it's something about web2py, so here goes.

I noticed that in instant Press, the application uses a top-level
class (superclass?) to load it's modules and their associated models
(the _i2p.py file in the models folder), and this class is
instantiated in db.py. I was trying to follow this pattern, and
noticed that if I don't prefix the file name with an underscore (e.g.
myclass.py), it isn't available, but as soon as I add that underscore
to the filename (e.g. _myclass.py) it works.

Why is this? All I could find in the Python documentation was mention
that functions that begin with an underscore are not loaded during "
from myclass import * ".

Thanks in advance!

Reply via email to