Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106466

Re: Best Practices for Internal Package Structure

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: Best Practices for Internal Package Structure
Date 2016-04-04 21:15 +0100
Message-ID <mailman.35.1459800975.32530.python-list@python.org> (permalink)
References <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> <57029E4F.1070606@mail.de> <CAGgTfkOALRxNhdk=aAn1N1ZFMTK8aCEPG0M6gTXfufyU34cBuQ@mail.gmail.com> <ndui1m$7hg$1@ger.gmane.org>

Show all headers | View raw


On 04/04/2016 19:45, Michael Selik wrote:
> On Mon, Apr 4, 2016 at 6:04 PM Sven R. Kunze <srkunze@mail.de> wrote:
>
>> Hi Josh,
>>
>> good question.
>>
>> On 04.04.2016 18:47, Josh B. wrote:
>>> My package, available at https://github.com/jab/bidict, is currently
>> laid out like this:
>>>
>>> bidict/
>>> ├── __init__.py
>>> ├── _bidict.py
>>> ├── _common.py
>>> ├── _frozen.py
>>> ├── _loose.py
>>> ├── _named.py
>>> ├── _ordered.py
>>> ├── compat.py
>>> ├── util.py
>>>
>>>
>>> I'd like to get some more feedback on a question about this layout that
>> I originally asked here: <
>> https://github.com/jab/bidict/pull/33#issuecomment-193877248>:
>>>
>>> What do you think of the code layout, specifically the use of the _foo
>> modules? It seems well-factored to me, but I haven't seen things laid out
>> this way very often in other projects, and I'd like to do this as nicely as
>> possible.
>>
>
> Using the _module.py convention for internals is fine, except that you have
> few enough lines of code that you could have far fewer files. Why create a
> package when you can just have a module, bidict.py?
>
> I find it easier to find the right section of my code when I have just a
> few files open rather than a dozen or so in different windows and tabs.
>

+1

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Best Practices for Internal Package Structure "Josh B." <jabronson@gmail.com> - 2016-04-04 09:47 -0700
  Re: Best Practices for Internal Package Structure "Sven R. Kunze" <srkunze@mail.de> - 2016-04-04 19:03 +0200
  Re: Best Practices for Internal Package Structure Michael Selik <michael.selik@gmail.com> - 2016-04-04 18:45 +0000
  Re: Best Practices for Internal Package Structure Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-04 21:15 +0100
  Re: Best Practices for Internal Package Structure Steven D'Aprano <steve@pearwood.info> - 2016-04-05 11:43 +1000
    Re: Best Practices for Internal Package Structure Steven D'Aprano <steve@pearwood.info> - 2016-04-06 09:29 +1000
    Re: Best Practices for Internal Package Structure Steven D'Aprano <steve@pearwood.info> - 2016-04-06 09:38 +1000
      Re: Best Practices for Internal Package Structure Steven D'Aprano <steve@pearwood.info> - 2016-04-06 12:09 +1000
    Re: Best Practices for Internal Package Structure Steven D'Aprano <steve@pearwood.info> - 2016-04-06 11:46 +1000

csiph-web