[Python-Dev] PEP 318 - generality of list; restrictions on elements

Michael Hudson mwh at python.net
Thu Mar 11 05:42:38 EST 2004


Guido van Rossum <guido at python.org> writes:

> In any case, *I* would prefer not to let the semantics require
> anything, and to make this just a (preferred) shorthand for applying
> arbitrary transformations to something that starts out as a function.

Sense at last <wink>!

> Two additional thoughts:
  ^^^

"No-one expects..."

> 1) I'm not sure I like using the same syntax for classes; the use
>    cases are so different that using similar syntax only adds
>    confusion, and I think the use cases for classes are a lot weaker
>    than for methods.

This is a marginal point, in my view.

> 2) The syntax should also apply to regular functions.

I wasn't aware that only applying it to methods had even been
considered for the tiniest fraction of an instant.  It would be
painful to implement and a transparently bad idea.

> 3) It needs to be crystal clear that the list of transformations is
>    applied at function/method definition time, not at class definition
>    time (which is later, after all the methods have been collected in
>    a namespace).

Given 2), that the syntax works for functions, I think this follows.
Besides, I can't think of a sane way of implementing the opposite...

Cheers,
mwh

-- 
  I would hereby duly point you at the website for the current pedal
  powered submarine world underwater speed record, except I've lost
  the URL.                                         -- Callas, cam.misc



More information about the Python-Dev mailing list