Accessors in Python (getters and setters)

Ant antroy at gmail.com
Wed Jul 19 15:03:11 EDT 2006


Ed Jensen wrote:

> > where the compiler prevents you from accessing
> > private variables, but the runtime allows access to these very variables
> > via reflection?
>
> Java does not allow access to private members via reflection.

Yes it does. You can call setAccessible(true) on the Method object to
override the privateness.




More information about the Python-list mailing list