def args idiom and signatures

Emile van Sebille emile at fenx.com
Wed Jan 19 22:34:46 EST 2000


----- Original Message -----
From: Michel Pelletier <michel at digicool.com>
Newsgroups: comp.lang.python
>
> > Now, in light of the various discussions pertaining to function
> > signatures, it seems that this idiom presents a particular problem.
>
> What problem is that?

Well, wouldn't this be exposing what probably ought to be a private
function variable?  If a function signature shows the def's argument
structure, how could a user tell that the intent is to *not* override
the value, and that doing so would break the function?  I know in
this case the value itself ("000031028...") pretty much says that, but
I can easily imagine other values being pre-set in the def to avoid
the overhead.

>
> > Various munging of the name or introduction of a static type keyword
> > may help address this, but I'm curious if this common usage and
> > what people's thoughts are.
>
> Zope uses this all time time, I find it quite useful.
>
> -Michel
> --
> http://www.python.org/mailman/listinfo/python-list
>



Emile van Sebille
emile at fenx.com
-------------------








More information about the Python-list mailing list