bruno at modulix wrote:
> Tim Chase wrote:
>>
>>class Foo:
>
> old-style classes are deprecated, please use new-style classes:
> class Foo(object):
>
This should be re-phrased to 'Use new-style classes, or else!'
py> class Foo:
... def __init__(self, color):
... self._color = color
...
Tim Chase wrote:
> I've set up an object and would like to make certain attributes
> read-only (or at least enforce it without doing extra work, as per
> name-mangling or the like). Ideally, the property would be set in the
> __init__, and then not be allowed to change.
>
> The best solution I've