Apparent "double imports" (was: Naming convention for in-house modules (Newbie question))

HoneyMonster someone at someplace.invalid
Thu Feb 9 13:53:54 EST 2012


On Thu, 09 Feb 2012 14:36:52 +0000, Arnaud Delobelle wrote:

> On 9 February 2012 14:00, Laurent Claessens <moky.math at gmail.com> wrote:
>>
>>> Here is my question: I would like to start an in-house library of
>>> small modules to import, for things like error handling/logging.
>>> That's easy enough, but is there a recommended way of naming such
>>> modules? I am concerned about avoiding name clashes with standard
>>> modules and site packages.
>>>
>>> Thanks.
>>>
>>>
>> This is not 100% an answer to the question, but you should read that :
>> http://www.python.org/dev/peps/pep-0008/
> 
> The OP mentions PEP 8 in the bit of his message that you *don't* quote.

Thank you for that Arnaud, and thanks to Chris R. I'm going along with 
Chris's suggestion for the moment.

One issue I have run into, which may or may not be a problem: I am 
finding that modules in the in-house "library" package sometimes have to 
import modules like sys and os, which are also imported by the "calling" 
module. Is this a problem or an overhead, or does it just result in two 
names for the same object?

Thanks again.



More information about the Python-list mailing list