[Zope] ZClasses vs. Python Products

Paul Winkler pw_lists@slinkp.com
Fri, 3 May 2002 11:35:56 -0700


Just to comment on a couple of your issues, I don't know about
all of them...

On Fri, May 03, 2002 at 12:33:44PM -0700, Sean Hastings wrote:
> However:
>     1. it then says why it is harder to change things in a python product.

First of all, the "__setstate__()" tip they mention is pretty easy
and will update all existing objects.

Secondly, __setstate__() is only necessary for *data* attributes; 
methods are automatically updated when the Product code is loaded, e.g.
when Zope starts.

Thirdly, you can force Product code to reload by using the
Refresh product. Saves a *lot* of time vs. restarting Zope
every time you want to check some changes. 

>     2. I can still use python scrips with Zclasses

Yes, but it's a bit hobbled. 
See e.g. the Advanced Scripting chapter of the Zope Book:
http://www.zope.org/Documentation/ZopeBook/ScriptingZope.stx
... the section "Security Restrictions".

Code in Python Products can do *anything*.

--PW

"Welcome to Muppet Labs, where the future is made - today!"