Metaclasses?
Dan Schmidt
dfan at harmonixmusic.com
Fri Apr 28 09:22:08 EDT 2000
Moshe Zadka <moshez at math.huji.ac.il> writes:
| On Thu, 27 Apr 2000, GTE wrote:
|
| > On the other hand I kinda like Visual Basic's 'with' construct. Consider:
| > def method(self,arg1,arg2):
| > with self:
| > .spam = "spam"
| > .eggs = arg1+arg2
|
| Here's a way to get almost that effect:
|
| def method(self, arg1, arg2):
| _ = self
| _.spam = "spam"
| _.egss = arg1 + arg2
I just do this:
def method(_, arg1, arg2):
_.spam = "spam"
_.eggs = arg1 + arg2
Will this practice get me kicked out of any Python Users Groups?
--
Dan Schmidt | http://www.dfan.org
More information about the Python-list
mailing list