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


Groups > comp.lang.python > #12942

Re: How to structure packages

References <2a4f542c-a8c1-46c7-9899-a3fad0940cf6@x11g2000yqc.googlegroups.com> <mailman.842.1315416661.27778.python-list@python.org> <4e680c67$0$29980$c3e8da3$5496439d@news.astraweb.com>
Date 2011-09-08 12:39 +1000
Subject Re: How to structure packages
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.863.1315449558.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 8, 2011 at 10:29 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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

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


Thread

How to structure packages bclark76 <bclark76@gmail.com> - 2011-09-07 08:56 -0700
  Re: How to structure packages John Gordon <gordon@panix.com> - 2011-09-07 16:11 +0000
    Re: How to structure packages Rafael Durán Castañeda <rafadurancastaneda@gmail.com> - 2011-09-07 19:18 +0200
  Re: How to structure packages Peter Otten <__peter__@web.de> - 2011-09-07 19:30 +0200
    Re: How to structure packages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-08 10:29 +1000
      Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-08 12:39 +1000
      Re: How to structure packages Dan Sommers <dan@tombstonezero.net> - 2011-09-08 09:51 +0000
      Re: How to structure packages Jonathan Hartley <tartley@tartley.com> - 2011-09-08 03:22 -0700
      Re: How to structure packages Nobody <nobody@nowhere.com> - 2011-09-09 01:45 +0100
        Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-09 11:37 +1000
          Re: How to structure packages Nobody <nobody@nowhere.com> - 2011-09-10 11:11 +0100
            Re: How to structure packages Chris Angelico <rosuav@gmail.com> - 2011-09-10 20:29 +1000
            Re: How to structure packages "Littlefield, Tyler" <tyler@tysdomain.com> - 2011-09-10 08:04 -0600
        Re: How to structure packages Alec Taylor <alec.taylor6@gmail.com> - 2011-09-10 02:38 +1000
  Re: How to structure packages rantingrick <rantingrick@gmail.com> - 2011-09-07 10:56 -0700
  Re: How to structure packages "Littlefield, Tyler" <tyler@tysdomain.com> - 2011-09-07 12:11 -0600
  Re: How to structure packages Westley Martínez <anikom15@gmail.com> - 2011-09-07 14:35 -0700

csiph-web