[posted & e-mailed]

In article <[EMAIL PROTECTED]>,
Piet van Oostrum  <[EMAIL PROTECTED]> wrote:
>
>There is.
>Inside a method there are 3 kinds of identifiers:
>- local ones e.g. parameters and local variables
>- global ones (actually module-level)
>- instance variables and methods
>
>Because Python has no declarations there must be a different way to
>indicate in which category an identifier falls. For globals it is done with
>the 'global' keyword (which actually is a declaration), for instance
>variables the dot notation (object.name) is used and the rest is local.
>Therefore every instance variable or instance method must be used with the
>dot notation, including the ones that belong to the object `itself'. Python
>has chosen that you can use any identifier to indicate the instance, and
>then obviously you must name it somewhere. It could have chosen to use a
>fixed name, like 'this' in Java or C++. It could even have chosen to use a
>keyword 'local' to indicate local ones and let instance ones be the
>default. But if instance variable would be implicit, local ones should have
>been explicit.

Any objection to swiping this for the FAQ?  (Probably with some minor
edits.)
-- 
Aahz ([EMAIL PROTECTED])           <*>         http://www.pythoncraft.com/

"The only problem with Microsoft is they just have no taste." --Steve Jobs
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to