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
--
http://mail.python.org/mailman/listinfo/python-list