[Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods)

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Fri, 14 Apr 2000 21:53:35 +0200


> > > There's nothing new here. Why does allowing the ability to=20
> > > obsfucate suddenly warrant a -1?
> >=20
> > since when did Python grow full lexical scoping?
>=20
> I know that's not Swedish, but I haven't the foggiest what=20
> you're getting at. Where did lexical scoping enter?
>
> > does anyone that has learned about the LGB rule expect
> > the above to work?
>=20
> You're the one who did "eff, bot =3D bot, eff". The only intent I=20
> can infer is obsfuction. The above works the same as yours,=20
> for whatever your definition of "work".

okay, I'll try again: in your example, the __call__
function refers to a name that is defined several
levels up.

in my example, the "foo" function refers to a name
that *looks* like it's in the same scope as the "x"
argument (etc), but isn't.

for the interpreter, the examples are identical.  for
the reader, they're not.

> Put it another way: are you reporting a bug in 1.5.2? If it's a=20
> bug, why is my example not a bug? If it's not a bug, why=20
> would the existence of other attributes besides __doc__ be a=20
> problem?

because people isn't likely to use __doc__ to store
static variables?

</F>