Why does python not have a mechanism for data hiding?

Antoon Pardon apardon at forel.vub.ac.be
Tue Jun 10 04:03:08 EDT 2008


On 2008-06-09, Lie <Lie.1296 at gmail.com> wrote:
>>
>> That seems strange to me. The and-or simulation that was offerd in the
>> FAQ allowed for about the same kind of structures as the ternary
>> operator in C and was used in the standard library IIRC.
>>
>> So the same unreadable was already possible to write, plus that it
>> could cause bugs and had to be made even more unreadable in order
>> to work correctly. Considering this it I find it odd that hurting
>> readability was a motivation not to have it.
>
> In case you didn't notice, the and-or simulation is a hack, it is not
> to be used by anyone writing real code (instead of for an entry to
> Obfuscated Python Code Contest) to substitute it for inline if. If
> inline if is "formalized", that means the language encourages the use
> of inline if, which we don't want to have.

Who is we? The last poll I know about had a majority in favor of a
ternary operator.

-- 
Antoon Pardon



More information about the Python-list mailing list