Using function parameters to determine method kind

Robert Brewer fumanchu at amor.org
Sun Jun 6 16:35:01 CEST 2004


Humpty Dumpty wrote:
> From: "Michele Simionato" <michele.simionato at poste.it>
> > No, I had in mind this (contrived) example:
> >
> > class Outer(object):
> >       def outermeth(self1):
> >           class Inner(object):
> >                 def innermeth(self2):
> >                     <do-something-with-self1-and-self2>
> >           ...
> >
> > It is nice to have the ability to give any name to "self".
> > like that).
> 
> Strange, I would have thought that self1 would not be in 
> scope (it's not in
> the local scope and it's not in the global scope AFAICT). If 
> true, you'd
> have to have a parameter to your innermeth, which you can 
> call whatever you
> want so call it self1. Have scoping rules changed in Python?

Before or after 2.2?

http://www.python.org/peps/pep-0227.html


FuManChu




More information about the Python-list mailing list