Joe Strout <[EMAIL PROTECTED]> writes:

> One thing I miss as I move from REALbasic to Python is the ability
> to have static storage within a method -- i.e. storage that is
> persistent between calls

This is precisely what classes are for: allowing functionality and
state to exist in a single object.

> but not visible outside the method.

Bind the state to a name with a single leading underscore (‘_foo’),
which is the convention for “not part of the public interface”.
Don't look for hard access restrictions, though, because they don't
really exist in Python.

-- 
 \     “I hope that after I die, people will say of me: ‘That guy sure |
  `\                            owed me a lot of money’.” —Jack Handey |
_o__)                                                                  |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to