What are modules really for?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    #31
    Re: What are modules really for?


    "Mike Meyer" <mwm@mired.or g> wrote in message
    news:86r7cy63wi .fsf@bhuda.mire d.org...[color=blue]
    > Magnus Lycka <lycka@carmen.s e> writes:[/color]
    [color=blue][color=green]
    >> Terry Reedy wrote:[color=darkred]
    >>> However, everything is an instance of a class or type.[/color][/color][/color]
    [color=blue][color=green]
    >> Except whitespace, comments, operators and statements!
    >> (Did I miss anything?)[/color][/color]
    [color=blue]
    > [snip] Maybe the properly
    > refined version of Terry's statement should be:
    >
    > Everything you can manipulate is an instance of a class or a
    > type.[/color]

    Yes and no.

    First, the context of the statement was a previous claim that some things
    are class instances and some not. So my point in that context was a) that
    adding 'or type' changes 'some' to 'every' and that new classes mostly
    eliminate the difference between class and type, making the addition
    eminently sensible. So while I thought of a qualifier like that, I left it
    out as irrelevant and a distractions.

    Second, any qualifier I can think of seems to have the danger of confusing
    as well as enlightening. One might not realize, for instance, that
    functions are something you can manipulate and might therefore mistakenly
    think that the qualifier excludes functions. I also thought of putting it
    as 'everything in Python's dataspace ...', but that has the same problem.

    Perhaps 'every runtime entity...'. would work. That seems to excludes
    source code (and things within source code like comments and whitespace and
    operator symbols), unless the code or pieces thereof *are* turned into (or
    wrapped as) string instances. Names might seem like an exception, but
    again, they are only accessible at runtime as string instances. Or maybe a
    more direct statement 'except for source code, everything...' would be
    better.

    So I have so far not settled on a 'best' context-free statement of the
    design principle.

    Terry J. Reedy



    Comment

    • bruno modulix

      #32
      Re: What are modules really for?

      Magnus Lycka wrote:[color=blue]
      > bruno modulix wrote:
      >[color=green]
      >> Magnus Lycka wrote:
      >>[color=darkred]
      >>> N.Davis wrote:
      >>>
      >>>
      >>>> Functions existing in a module? Surely if "everything is an object"
      >>>> (OK thats Java-talk but supposedly Python will eventually follow this
      >>>> too)
      >>>
      >>>
      >>>
      >>> int too? ;)[/color]
      >>
      >>
      >>
      >> Yes, int too.[/color]
      >
      >
      > I was talking about everything being an object in Java...[/color]

      Oops ! Sorry, my misreading :(


      --
      bruno desthuilliers
      python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
      p in 'onurb@xiludom. gro'.split('@')])"

      Comment

      Working...