![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code
From: Ralf W. Grosse-Kunstleve <rwgk@yahoo.com>
Date: Tue Jul 12 2005 - 00:19:29 CEST
--- Lonnie Princehouse <finite.automaton@gmail.com> wrote:
> IIRC, the self.__dict__.update(locals()) trick confuses psyco.
Not if you have (enough memory for) psyco. :)
http://mail.python.org/pipermail/python-list/2005-July/289721.html
> def attribute_decorator(f):
Thanks! Rob Williscroft had a similar suggestion:
http://mail.python.org/pipermail/python-list/2005-July/289734.html
Does anyone know if there is a way to hide the _ or self_ from the user of the
class foo(object):
can we make it such that the user can still write
foo(x=1,y=2,z=3)
without the underscore?
Cheers,
|