Kent Johnson wrote:
The reason that is given for using accessors is that it gives you a
layer of flexibility; if you want to change the representation of the
data, or make it a computed attribute, you can do that without impacting
clients.
Python, instead, lets you change what attribute access
On Jan 18, 2005, at 22:50, Kent Johnson wrote:
Python, instead, lets you change what attribute access means. The way
to do this is with 'properties'. This is kind of an advanced topic,
here are two references:
http://www.python.org/2.2.1/descrintro.html#property
http://www.python.org/doc/2.2.
Paul Tremblay wrote:
On Fri, Jan 14, 2005 at 08:11:32PM -0500, Kent Johnson wrote:
- typical Python style is *not* to define setter and getter functions. If
you need to mediate attribute access you can do it later using properties.
I treid to figure out how this works with no luck. It seems that
ct: Re: [Tutor] style question: when to "hide" variable, modules
>
> A few thoughts:
> - you might want to make a configuration object that you can pass around,
> this is probably better than passing around an instance of the main Burn
> class.
I actually pass around many i
I'm not too sure about this...
Couldn't you make that a package?
Rename Backup.py to __init__.py
Put all of the modules in a folder named Backup
in your sys.path - Question: Does it have to be
in site-packages?
Well, there's my two bits,
Jacob
> During the recent discussion on jython, a poster
>
A few thoughts:
- you might want to make a configuration object that you can pass around, this is probably better
than passing around an instance of the main Burn class.
- typical Python style is *not* to define setter and getter functions. If you need to mediate
attribute access you can do it la
> My question is, how far should one take these guidlines?
My response is, as far as you need and no further.
In other words if it would actually cause problems
for clients to access those variables disguise them,
but otherwise trust your fellow programmers not to
be stupid.
Its the same princ
During the recent discussion on jython, a poster
brought up the good point that one should hide
variables and modules to indicate that they are
not for public use:
self.__for_internal_purposes = 5
__internal_stuff.py
"""
This module only makes sense for use with
the parent module.
"""
So one co