Confessions of a Python fanboy
garrickp at gmail.com
Thu Jul 30 14:06:33 EDT 2009
On Jul 30, 11:56 am, Masklinn <maskl... at masklinn.net> wrote:
> On 30 Jul 2009, at 19:37 , Jean-Michel Pichavant wrote:
> > r wrote:
> > How do I know if foo.value is an attribute or if it is a method that
> > returns the foo value ?
> It cannot be an attribute. Ruby doesn't give access to attributes,
> they're always solely private (as in Smalltalk). Also you shouldn't
> reply to r, he has no idea about what he's talking about.
That doesn't sound like a feature I would appreciate much, though I am
a big fan of "we're all adults here" programming. Though if they are
all functions, then adding parentheses wouldn't make much difference,
so offering the option of getting rid of them makes sense.
>> I would have
>> trouble saying, just based on the calls above. I would have to go back
>> to the definition or documentation of foo to identify which is doing
>> what. On the other hand, the following gives a better clue as to what
>> is happening (granted not perfect, but better):
> Well... it doesn't give much of a clue no really.
It, with few exceptions, tells me that fetching the value foo.val will
not modify the state of foo. Important stuff, at least to me.
More information about the Python-list