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


Groups > comp.lang.python > #106460

Re: Best Practices for Internal Package Structure

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Michael Selik <michael.selik@gmail.com>
Newsgroups comp.lang.python
Subject Re: Best Practices for Internal Package Structure
Date Mon, 04 Apr 2016 18:45:35 +0000
Lines 39
Message-ID <mailman.30.1459795553.32530.python-list@python.org> (permalink)
References <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> <57029E4F.1070606@mail.de> <CAGgTfkOALRxNhdk=aAn1N1ZFMTK8aCEPG0M6gTXfufyU34cBuQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de hdPP/sI5Tv8sYdeBSh+cfwsJHvXJZhC8fpSSh9FjR20w==
Return-Path <michael.selik@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.024
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'nicely': 0.07; 'url:github': 0.09; 'files.': 0.13; 'package,': 0.13; 'question.': 0.13; '2016': 0.16; '__init__.py': 0.16; 'layout,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'module,': 0.18; '&gt;': 0.18; 'windows': 0.20; 'to:2**1': 0.21; 'fine,': 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; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'projects,': 0.27; 'specifically': 0.28; 'josh': 0.29; 'asked': 0.29; 'code': 0.30; 'convention': 0.30; "i'd": 0.31; 'open': 0.33; 'except': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'lines': 0.36; 'possible.': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'received:209': 0.38; 'feedback': 0.38; 'files': 0.38; 'received:209.85.220': 0.38; 'why': 0.39; 'enough': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'more': 0.63; 'different': 0.63; 'here:': 0.63; '18:47,': 0.84; 'subject:Internal': 0.84; 'subject:Practices': 0.84; 'dozen': 0.91; 'subject:Best': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=lSuC9+r1fsgWxH+SZtPpq/3gxUiqTtLTMcOIVqPoA0A=; b=xlKsTVI4AC0Btt8xOmN1dH7x/jNOjPAjGoKTnH3rJPD06vB21n6ESIN2qX6kfoLcl4 V+GS1jND8Hxl10Y5OeUgDASkN7t8VtoGqcNKM5Qip1tA9aA72YvLQHRZnKjWbx9D9JMU N8bqs7xijc2BsZAOkR4+l9azEQlx0Ga1CF1nc3NuD55YRfg1DOn6N2PmIqf0P4M0nA3h uCwQnIQVwnV2e2EHFE4lQhmwc437j/QN5cICV93INKFQCuv2EKDgWYSYs5y5alylvwxN 1PkG2SUxzNG8AU94UrDXLK5g6rB+5TySR1LuTWUvmVa6R4RnB/Jjp1ETQ89daZxYvYbc r9kQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=lSuC9+r1fsgWxH+SZtPpq/3gxUiqTtLTMcOIVqPoA0A=; b=Zzydv15TXFpZ+Dp4p968OavAIR1YnVrDuCzC4VXd7LYCLOPrL3glYWBe/hDAU1wSgS i5/Gu5+m44Ykkn/p9OgCHZVT576nl5oBmOmFYeeFS4K5sXvDHyDXp/joOy8thYo4SjSJ 3d9pQ0tVH0LZ2bUjZUVNQwsC1PDY6IEPcLsSSHcksFr7hmgd+KFFGJAPcl8TsOKhDO7N Dl6lozE+IMBhQdjjHhogWpusLKULfUTGGwe3lTg4pqSM3C15xLajrsb7r25qa8hqaewv +et36DbmaT5BXe97+RPVQoAJY6GijMxtcTNB0XHblhDDx/Xx6Cwfx3NAwG5/NflZXwam 7fYw==
X-Gm-Message-State AD7BkJKbCbW1n4nGFIRqD7eSbYz8JRgZjxnZ5FgCN+VEWUeiTUZu0BetGcVU9db5W/1FsBysumLYw69GH6/IbA==
X-Received by 10.55.24.208 with SMTP id 77mr36688514qky.45.1459795545665; Mon, 04 Apr 2016 11:45:45 -0700 (PDT)
In-Reply-To <57029E4F.1070606@mail.de>
X-Content-Filtered-By Mailman/MimeDel 2.1.21
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 <CAGgTfkOALRxNhdk=aAn1N1ZFMTK8aCEPG0M6gTXfufyU34cBuQ@mail.gmail.com>
X-Mailman-Original-References <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> <57029E4F.1070606@mail.de>
Xref csiph.com comp.lang.python:106460

Show key headers only | View raw


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.

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