type function does not subtype

Lenard Lindstrom nada at nowhere.xxx
Wed Mar 26 05:29:35 CET 2003


"Greg Ewing (using news.cis.dfn.de)" <me at privacy.net> wrote in message
news:b5qnia$2863q6$1 at ID-169208.news.dfncis.de...
> Lenard Lindstrom wrote:
> > In a class definition '__metaclass__ = something' is an actual
assignment
> > statement.
>
> Guido is on record as saying that's just a detail of
> the current implementation.
>
> But I've had a better idea:
>
>    def f(arg, ..., __functionclass__ = myfunkyfunc):
>      ...
>
> Now it's a real assignment (of a default argument value),
> and it's outside the function's local scope, and it's
> restricted to that function!
>
> Happy now? :-)
>
> --
>...
Actually I was happy with your first suggestion. However in a previous
posting someone proposed having C like static variable declarations within a
function body. Beni Cherniavsky said this would complicate things since all
function bodies would then have to be checked for the special code (
messages 11 and 12 of 'PEP 309 - Built-in closure type (with tentative
syntax proposal)' ). It seems to me __functionclass__ in the function body
would be the same way. Having __functionclass__ in the argumet list is fine
with me as well. And it doesn't require a syntax change.

Lenard Lindstrom
"<%s@%s.%s>" % ("len-l.", "telus", "net")







More information about the Python-list mailing list