Does Python really follow its philosophy of "Readability counts"?
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Wed Jan 14 07:07:43 EST 2009
On Wed, 14 Jan 2009 10:53:33 +0000, Marc 'BlackJack' Rintsch wrote:
> On Wed, 14 Jan 2009 07:14:06 +0000, Steven D'Aprano wrote:
>
>> On Wed, 14 Jan 2009 15:25:38 +1000, James Mills wrote:
>>
>>> On Wed, Jan 14, 2009 at 3:11 PM, Russ P. <Russ.Paielli at gmail.com>
>>> wrote: (...)
>>>
>>>>> Give me one use-case where you strictly require that members of an
>>>>> object be private and their access enforced as such ?
>>>>
>>>> You're kidding, right? Think about a ten-million line program being
>>>> developed by 100 developers.
>>>
>>> No I"m sorry this is not a valid use-case.
>>
>> Why not? Just saying it isn't doesn't make it not.
>
> Because "developer" means people who don't mess with implementation
> details. So they respect the leading underscore convention. No use
> case for enforced access restriction.
O rly? *raise eyebrow*
http://www.clausbrod.de/cgi-bin/view.pl/Blog/
WebHome#DefinePrivatePublic20080413_This
or http://snipurl.com/a0ujm
Sometimes developers have to work around encapsulation in their own code:
http://www.gamedev.net/community/forums/topic.asp?topic_id=386856
Sometimes they do it just because they can:
http://java-interview-faqs.blogspot.com/2008/08/hacking-by-reflection-
accessing-private.html
or http://snipurl.com/a0tox
And try this:
http://www.google.com/codesearch?q=%22%23define+private+public%22
--
Steven
More information about the Python-list
mailing list