How much is set in stone?

Ype Kingma ykingma at accessforall.nl
Wed Nov 7 15:08:24 EST 2001


Jive,

you wrote:
> [snip] 
> 
> There's a pragmatic reason I'm asking for this feature.  One of our
> customers has suggested that we implement scripting using Python.  I've
> looked into Python, and I am very impressed with what I see.  But I
> would have grave misgivings giving it to customers with variable
> declarations the way they are now.  I'm not sure I could sell the boss
> on it, and don't know if I would want to.  The situation is quite
> different from writing code on ones own computer to be used in-house.

I suppose you know that using an unitialised variable will cause a NameError
exception?

> These programs will run equipment, often in foreign countries, that can
> break literally a million dollars worth of merchandise, and could even
> hurt somebody.  It is very important to find bugs BEFORE a program goes

If that is the case you might consider not using python, but a more typesafe
language, and make sure that your customer only uses his own code _after_
inspecting and testing it thoroughly.

Python is dynamic and not typesafe, which means that any object can do
almost anything to any object at any point in time. For example when a class
defines a method, that method can be overriden for any object of that class
_dymically_, even while the overriden method is being executed. 
I have not tried it, but I would not be surprised if the method can even
be removed from the class while the program is running.

By the way, this dynamic nature would also render your proposed enhancement
non functional: a variable can be deleted from some namespaces at any time.
Using such a variable after its deletion will cause a NameError exception.

> into production use.  I won't have any say over who writes these
> programs, but bugs that appear to be compiler bugs ("Why doesn't that
> variable change when I assign to it?") will get bounced right to me.
> 
> Of course, since the source code is freely available, I could implement
> it on our copy only.  But that would be inefficient.  By your own
> account, lots of other people want the feature also.
> 
> Jive

Regards,
Ype

-- 
email at xs4all.nl



More information about the Python-list mailing list