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


Groups > comp.lang.python > #106466

Re: Best Practices for Internal Package Structure

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: Best Practices for Internal Package Structure
Date Mon, 4 Apr 2016 21:15:46 +0100
Lines 49
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>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de WmJ4eoRzQtXJDbV8m1oH0AhVVQcJ5kW48ntMe44I8rrg==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'nicely': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; 'files.': 0.13; 'package,': 0.13; 'question.': 0.13; '2016': 0.16; '__init__.py': 0.16; 'layout,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'module,': 0.18; 'language': 0.19; '>>>': 0.20; 'windows': 0.20; 'fine,': 0.22; 'lawrence': 0.22; 'seems': 0.23; 'originally': 0.23; 'this:': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'question': 0.27; 'projects,': 0.27; 'specifically': 0.28; 'josh': 0.29; 'asked': 0.29; 'code': 0.30; 'convention': 0.30; "i'd": 0.31; 'language.': 0.32; 'michael': 0.33; 'open': 0.33; 'except': 0.34; 'could': 0.35; 'but': 0.36; 'lines': 0.36; 'possible.': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'things': 0.38; 'feedback': 0.38; 'files': 0.38; 'why': 0.39; 'enough': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'some': 0.40; 'more': 0.63; 'different': 0.63; 'here:': 0.63; 'our': 0.64; '18:47,': 0.84; 'pythonistas,': 0.84; 'subject:Internal': 0.84; 'subject:Practices': 0.84; 'dozen': 0.91; 'subject:Best': 0.93
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host 80.234.189.93
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1
In-Reply-To <CAGgTfkOALRxNhdk=aAn1N1ZFMTK8aCEPG0M6gTXfufyU34cBuQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <ndui1m$7hg$1@ger.gmane.org>
X-Mailman-Original-References <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> <57029E4F.1070606@mail.de> <CAGgTfkOALRxNhdk=aAn1N1ZFMTK8aCEPG0M6gTXfufyU34cBuQ@mail.gmail.com>
Xref csiph.com comp.lang.python:106466

Show key headers only | 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