Re: imports in __init__.py

2009-12-26 Thread lotrpy
On Dec 18, 12:34 pm, Ben Finney wrote: > Phil writes: > > From an arbitrary python module, I 'import packagename'. > > At that point, you have all the names that were defined within > ‘packagename’, available inside the namespace ‘packagename’. Since > ‘modulename’ is a module in that package, th

Re: imports in __init__.py

2009-12-18 Thread Peter Otten
Phil wrote: > I wrote my last message late last night. When I said "I am unable to > import a module from the package without an import error.", I did mean > the 'modulename' module. > > However, I just set up a Debian VM with Python 2.5.2 and what I was > trying to do works. So it is either some

Re: imports in __init__.py

2009-12-18 Thread Phil
I wrote my last message late last night. When I said "I am unable to import a module from the package without an import error.", I did mean the 'modulename' module. However, I just set up a Debian VM with Python 2.5.2 and what I was trying to do works. So it is either something that changed with P

Re: imports in __init__.py

2009-12-18 Thread sKeeZe
I wrote my last message late last night. When I said "I am unable to import a module from the package without an import error.", I did mean the 'modulename' module. However, I just set up a Debian VM with Python 2.5.2 and what I was trying to do works. So it is either something that changed with P

Re: imports in __init__.py

2009-12-17 Thread Phil
I understand all of the above, including the reasons as to why this is bad. For purposes of experimenting, I would still like to do it. I guess I'm (still) wondering how it is done in webpy. I recall seeing it done elsewhere too. All I noticed was that in webpy's package 'web', it defines the 'ap

Re: imports in __init__.py

2009-12-17 Thread Ben Finney
Phil writes: > I use distutils / setup.py to install 'packagename', where... > /packagename > __init__.py > modulename.py > > modulename.py has a class named 'classname'. As per PEP 8, it's best if user-defined classes are named with TitleCase, so ‘ClassName’. > From an arbitrary python

imports in __init__.py

2009-12-17 Thread Phil
I use distutils / setup.py to install 'packagename', where... /packagename __init__.py modulename.py modulename.py has a class named 'classname'. >From an arbitrary python module, I 'import packagename'. In said module, I want to use the 'classname' class from 'packagename.modulename', by