[Zope] zope, python, and double underscores

Dieter Maurer dieter@handshake.de
Fri, 8 Feb 2002 23:12:25 +0100


Adam Garratt writes:
 > can anyone tell me why in the world zope gives me these snide
 > 
 >         "__init__" is an invalid variable name because it starts with "_"
 >         "__repr__" is an invalid variable name because it starts with "_"
 >         "__name__" is an invalid variable name because it starts with "_"
 > 
 > errors when i try to run a script that works outside of zope.  i'm 
 > relatively new to zope, and very new to python.  nevertheless, i know 
 > that i'm using __init__, __name__, and __repr__ correctly.
Names starting with '_' are private in Zope and cannot be accessed
in TTW code. Use an External method (or disk based product) when
you need to access such attributes.

An alternative would be XXPythonScripts.


Dieter