the annoying, verbose self

Kay Schluehr kay.schluehr at gmx.net
Sat Nov 24 02:43:53 EST 2007


On 24 Nov., 07:29, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> On Fri, 23 Nov 2007 20:48:06 -0800, Kay Schluehr wrote:
> > I like this pattern but less much I like the boilerplate. What about
> > an explicit unpacking protocol and appropriate syntax?
>
> > def abs(self):
> >      x, y, z by self
> >      return math.sqrt(x**2 + y**2 + z**2)
>
> > expands to
>
> > def abs(self):
> >      x, y, z = self.__unpack__("x","y","z")
> >      return math.sqrt(x**2 + y**2 + z**2)
>
> What about ``from`` instead of ``by``?  That's already a keyword so we
> don't have to add a new one.
>
> Ciao,
>         Marc 'BlackJack' Rintsch

I'm rather passionless about keyword selection. I selected a new one
because I didn't want to discuss possible syntactical conflicts or
confusions that might arise by reusing an existing keyword. I think
'from' is fine when it works for the majority of those who are
interested in the proposed statement semantics.

Ciao, Kay



More information about the Python-list mailing list