[Python-ideas] Mitigating 'self.' Method Pollution

Steven D'Aprano steve at pearwood.info
Sat Jul 11 17:10:04 CEST 2015


On Sat, Jul 11, 2015 at 02:53:51PM +0300, Joonas Liik wrote:
> On 11 July 2015 at 12:54, M.-A. Lemburg <mal at egenix.com> wrote:
> >
> > with self:
> >      x = 5
> >      y = 6
> >
> 
> sounds a lot like JavaScript: the bad parts and has the exact same shortcomings.
> consider:


It's actually taken from Pascal, where it works quite well due to the 
necessity of explicit declarations of all variables and record fields.

There's even a Python FAQ about it. So don't worry, Python won't get 
this construct.


-- 
Steve


More information about the Python-ideas mailing list