[Zope] RE: Forbidden Variable Names

Ren Bing bing.ren@eastip.com
Tue, 26 Mar 2002 17:02:14 +0800


Hi, Roger:

Thanks. I agree, a whole morning is not that bad.
But the point is the name is "client" but not "id", I know "id" should be
avoid of, but who expects "client"? And the most important is that, there's
nowhere mentioned "client", and supposely explicitly specified argument or
variable should override other thing except reserved keyword of python
language, is that right? OK, I checked python documentation, "client" is not
a reserved keyword.

My understanding is that something named "client" is used in the same
namespace, if this is some internal one and must reside in the same space
with arguments, it should be renamed to "__client__" for better.

Anyway, I am grateful for guys who brings Zope out. It's true flexible and
amazing :-) I wish this bug fixed ASAP.

Thanks

Ren Bing

-----Original Message-----
From: Roger Erens [mailto:rerens@dela.org]
Sent: Tuesday, March 26, 2002 4:49 PM
To: 'Ren Bing'
Cc: 'zope@zope.org'
Subject: Forbidden Variable Names


Hi Bing,

> Dear all:
>
> A bug in Z SQL method wasted my whole precious morning! Write

That's what bugs are supposed to do, if not wasting whole precious days!

> replaced argument name "client" to "clientname" , then
> everything is fine.
>
> Woo, but WHY???? what's inside this? I didn't read this at
> anywhere. Is
> there still more like this ahead?

Apparently "client" is something like a reserved variable/keyword, and you'd
better not use these words for your own variables. Same case for "id" and
probably many more variable names.

It would be nice indeed to have a list somewhere on zope.org or in the book
with 'forbidden variable names'. (Debugger: Aiieeee! "client" is an FVN!)

Enjoy the remaining of your afternoon,

Roger