Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Sven R. Kunze" Newsgroups: comp.lang.python Subject: Re: Best Practices for Internal Package Structure Date: Mon, 4 Apr 2016 19:03:11 +0200 Lines: 38 Message-ID: References: <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> <57029E4F.1070606@mail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de cFPf3RheR4c4Crlr8SDmQQ2iyxzl8JoJMRbrGfhGLCeQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'nicely': 0.07; 'url:github': 0.09; 'bug': 0.10; 'itself.': 0.11; 'output': 0.13; 'package,': 0.13; 'question.': 0.13; 'weird': 0.15; '__init__.py': 0.16; 'layout,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'do.': 0.22; 'seems': 0.23; 'originally': 0.23; 'this:': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; 'question': 0.27; 'projects,': 0.27; 'specifically': 0.28; 'looks': 0.29; 'josh': 0.29; 'asked': 0.29; 'code': 0.30; "i'd": 0.31; 'maybe': 0.33; 'similar': 0.33; 'received:10.0': 0.34; 'best,': 0.35; 'requiring': 0.35; 'but': 0.36; 'should': 0.36; 'possible.': 0.36; 'modules': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'things': 0.38; 'feedback': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'some': 0.40; 'more': 0.63; 'here:': 0.63; 'within': 0.64; '18:47,': 0.84; 'internally.': 0.84; 'subject:Internal': 0.84; 'subject:Practices': 0.84; 'subject:Best': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1459789392; bh=hfj0ZWMvi+kcZl9fGirFVxUaInlaWH8sKMw+mUsJ/Ao=; h=Subject:To:References:From:Date:In-Reply-To:From; b=kuTgzqiLg4m8PWxBU0+mCHNjya4eHseqTdNpXcowiwDSLqofnjblIto6M1ARgVvmB vT90E79w2rHwH+CKwszIjs5WlrQFAp1o23/NpoOmWjXluzOi2Ora4yC17+ifAQVp5s qG+mOm4Bofx7B3W7TXHPqYivvY9Y8bzaZI1n3YjU= In-Reply-To: <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1225 X-purgate-ID: 154282::1459789392-00000859-0A343B72/0/0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <57029E4F.1070606@mail.de> X-Mailman-Original-References: <22a2f21d-7fd2-468a-9b6e-184837506157@googlegroups.com> Xref: csiph.com comp.lang.python:106457 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: : > > 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. > > It does kind of bug me that you see the _foo modules in the output when you do things like this: > [code] we had a similar discussion internally. We have various packages requiring each other but have some internals that should not be used outside of them. The _ signifies that actually clearly but it looks weird within the package itself. We haven't found a solution so far. Maybe others do. Best, Sven