Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'received:209.85.160.174': 0.09; 'received:mail-gy0-f174.google.com': 0.09; 'sells': 0.09; 'am,': 0.12; 'classes,': 0.13; 'file).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'prepared.': 0.16; 'significance': 0.16; 'written': 0.16; 'wrote:': 0.16; "haven't": 0.20; 'java': 0.21; 'header:In-Reply-To:1': 0.22; 'sep': 0.23; 'code': 0.25; "i'm": 0.27; 'classes': 0.28; 'thu,': 0.28; 'message-id:@mail.gmail.com': 0.29; '(so': 0.30; 'btw,': 0.30; 'class': 0.30; 'source': 0.33; 'actually': 0.33; 'to:addr:python- list': 0.33; 'file.': 0.34; 'rather': 0.35; 'received:209.85.160': 0.35; 'object': 0.35; 'subject:How': 0.35; 'file': 0.36; 'think': 0.38; 'steven': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; "it's": 0.40; 'your': 0.61; 'back': 0.62; 'mechanical': 0.67; 'true;': 0.67; 'serious': 0.78; 'fan,': 0.84; 'non-public': 0.84; 'otten': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SoKi/lJtoG+VOZJ1ouTGGnGEgb0O4az+fdDn3hCD9OY=; b=SI2+ApAv8wEhgTpSEiRRo0+gdXvPtxO8lZ5E015mo0x7xA5r7rdmL/iN2ZLzZEXx8O HWQvlDD62tQDdaSDa+51ZkWJVAikA9rQ55wB2xb7IacpwdpFu7AP7fA+7yptrC4Rmrd5 VDuPc4Mcw3n6kc+r3AXSGsX9Zz76vIQwNPWoQ= MIME-Version: 1.0 In-Reply-To: <4e680c67$0$29980$c3e8da3$5496439d@news.astraweb.com> References: <2a4f542c-a8c1-46c7-9899-a3fad0940cf6@x11g2000yqc.googlegroups.com> <4e680c67$0$29980$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 8 Sep 2011 12:39:16 +1000 Subject: Re: How to structure packages From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315449558 news.xs4all.nl 2477 [2001:888:2000:d::a6]:43303 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12942 On Thu, Sep 8, 2011 at 10:29 AM, Steven D'Aprano wrote: > Peter Otten wrote: > >> Classes and functions are grouped into >> submodules by their functionality rather than employing Java's mechanical >> one-class-per-file pattern. > > Surely it's an anti-pattern? I don't think that's true; Java merely enforces one _public_ class per source file. A file can have non-public classes, although one .class file has only one class in it (so javac will sometimes make multiple object files from one source file). I'm not wholly sure of the significance of public classes, though, and whether or not it's possible to do your logical grouping and just let them be non-public. BTW, I am not a Java fan, and I don't have any defense prepared. I haven't actually written any serious Java code for a number of years. Used to use it back when IBM reckoned that Java would be the big thing that sells OS/2. ChrisA