'with' statement in python ?

asgard asgard at hellnet.cz
Mon Jun 25 14:33:11 EDT 2001


Hello,
writing self before every object's method really drives me
crazy. Shouldn't there be 'with' statement like in Pascal, ie.

self.a=1
self.b=2

could be written as

with self:
    a=1
    b=2

? Of course it would work with other names too.

Have anyone considered this, is it a total nonsense or probably should I
write a PEP ? (I am not able to implement it myself anyway).

Thanks 
Regards Jan Samohyl





More information about the Python-list mailing list