[Zope] Re: [Zope-dev] Re: PythonLibraries Product

Terry Hancock hancock at anansispaceworks.com
Wed Sep 10 08:17:55 EDT 2003


On Wednesday 10 September 2003 06:14 am, Seb Bacon wrote:
> Evan Simpson wrote:
> > I'm thinking seriously about writing a Product to provide collections of 
> > Python functions defined by a single source text -- PythonLibraries. 
> > This would *not* be the same as Zope 3's persistent modules, although it 
> > would provide some of the same benefits.

> So AFAICT it's a convenience which allows you (a) to keep related 
> functions together; and (b) to store local variables in a convenient 
> place.  It definitely sounds useful but also a lot of work for something 
> it's possible to manage without quite easily at the moment..?
> 
> Could you provide a brief summary of why this is better than a folder of 
> python scripts?  Perhaps a use case which illustrates the problems of 
> the current way of doing things?

Well, I can inject a reply to that part -- such a product would allow
python code that actually looks like real python (e.g. with function
definitions).  It also seems likely that it could byte-compile better as
a result.

You can at present write a script that defines functions, but the
downside is that they are defined each time you run the script! (Because
they're really nested functions, since they run inside of what ultimately
is the body of a function).

It might well encourage more use of python for logic without having
to go to the step of creating specialized products.  Or so it seems
to me, as a mostly-innocent bystander. ;-)

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the Zope mailing list