Proposal: Python Class Files
Chuck Esterbrook
echuck at mindspring.com
Fri Oct 6 21:18:08 EDT 2000
At 09:14 PM 10/6/00 -0400, Michal Wallace wrote:
>On Sat, 7 Oct 2000 echuck at mindspring.com wrote:
>
> > In article <mailman.970844952.10953.python-list at python.org>,
> > Michal Wallace <sabren at manifestation.com> wrote:
> > > Class files would work like this:
> > >
> > > 1. Each class file contains one and only one class.
> >
> > Why? If we have Foo.pc, but the Foo class requires some supporting
> > internal classes, I should be allowed to create them in the same
> > module. However, they wouldn't get put in the containing name space.
>
>You can still do that. Just make the internal class... well,
>internal.. :)
>
> >>> class Foo:
> >>> class Bar:
> >>> x = 1
> >>> def __init__(self):
> >>> aBar = Foo.Bar()
> >>> print aBar.x
> >>>
> >>> f = Foo()
>1
>
>Then the Bar class is just a member of Foo.
>I guess I should say one and only one TOP LEVEL class..
Or you could say that the top level class whose name matches the file gets
exported.
>Cheers,
>
>- Michal
>------------------------------------------------------------------------
>www.manifestation.com www.sabren.com www.linkwatcher.com www.zike.net
>------------------------------------------------------------------------
- Chuck
--------------------------------------------------------------
http://webware.sourceforge.net http://webware.sourceforge.net
--------------------------------------------------------------
More information about the Python-list
mailing list