[Python-Dev] reducing self.x=x; self.y=y; self.z=z boilerplate code (original) (raw)

Aahz aahz at pythoncraft.com
Sat Jul 2 06:37:11 CEST 2005


On Fri, Jul 01, 2005, Ralf W. Grosse-Kunstleve wrote:

I often find myself writing: class grouping: def init(self, x, y, z): self.x = x self.y = y self.z = z I hate it, and every time I show this to a Python newcomer I get that skeptic look. How about this for a change? class grouping: def init(self, .x, .y, .z): pass

This is off-topic for python-dev. Please take it to comp.lang.python. (It's not immediately obvious that this is off-topic, I know, but please take my word for it.)

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.



More information about the Python-Dev mailing list