On Jan 27, 10:57 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Wildemar Wildenburger <[EMAIL PROTECTED]> writes:
> > class Server(object):
> >      def __init__(self, self.host, self.port,
> >                   self.protocol, self.bufsize, self.timeout):
> >          pass
> > ?
>
> That could temporarily bind those attributes but it shouldn't
> persistently mutate the object.
>
> How about:
>
>     class Server(object):
>          def __init__(self, host, port, protocol, bufsize, timeout):
>             self.(host, port, protocol, bufsize, timeout) = \
>                   host, port, protocol, bufsize, timeout
>
> That's fairly explicit yet cuts down the total amount of boilerplate.

Not much; you're still repeating each variable name 3 times.  I prefer
the standard way of one definition per line over this notation
myself.

André
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to