|
![](/i/fill.gif) |
On 10/22/2012 6:53, Warp wrote:
> Darren New<dne### [at] san rr com> wrote:
>> Having underlings as part of the name isn't any more "special" than it is in
>> C or C++. However, I cannot name my own function "operator'" in C++ because
>> the "operator" keyword actually is special syntax.
>
> 'operator' is a keyword that's fairly descriptive. '__' in a variable name
> as required syntax isn't very descriptive.
That's a fair complaint.
>> I can name my function
>> __quote__ in Python because that function name has no special meaning to the
>> interpreter.
>
> That's contradictory with:
>
>> When the interpreter sees "a + b" it first looks to see who implements
>> __add__, and then invokes that.
>
> So it does have a special meaning to the interpreter, or it doesn't?
As I thought I said, __add__ has special meaning, __quote__ does not. It's
not the presence of the __ that makes it magic. It's the entire name.
--
Darren New, San Diego CA, USA (PST)
"They're the 1-800-#-GORILA of the telecom business."
Post a reply to this message
|
![](/i/fill.gif) |