On Sat, 28 Mar 2015 03:18 pm, Rustom Mody wrote: > One thing that is a bit laborious in python are object initializers: > > self.attr1 = field1 > self.attr2 = field2 > > In VB one can do: > > with self > .attr1 = field1 > .attr2 = field2 > > (or something like that -- dont exactly remember the syntax)
Pascal is another language with a construct like that, and there's a FAQ for it: https://docs.python.org/2/faq/design.html#why-doesn-t-python-have-a-with-statement-for-attribute-assignments -- Steven -- https://mail.python.org/mailman/listinfo/python-list