Newbie Q: Class Privacy (or lack of)

Ray ray_usenet at yahoo.com
Fri Jul 28 03:15:09 EDT 2006


Bruno Desthuilliers wrote:
> > I'd rather let a machine to do that. Wasn't computer created for tasks
> > like this? (No, not really. But...)
>
> There's obviously a trade-off between 'security' and flexibility. As I
> said, I do make lots of typo too, but OTOH the edit/test cycle in Python
> is usually so short that such errors are not a problem for me - they're
> caught almost immediatly.

Actually Bruno,  don't you think that the notion of flexibility in
Python comes at the expense of "security" is simply due to the fact
that the syntax of "screw up" is exactly the same as the syntax of "I
mean it this way and I do want it"?

Perhaps if we use a different syntax when we want to say "I really want
this", it'll be better (so Python can differentiate between a typo and
a conscious decision). So going back to the original example, you won't
be able to say:

x.func = 789 and destroy the function func--Python will raise an error.
Instead you have to type a different syntax to tell Python that yes, I
do want to overwrite a function with 789.

Dunno, just throwing out ideas here :)

Cheers
Ray

<snip>
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in 'onurb at xiludom.gro'.split('@')])"




More information about the Python-list mailing list