POV-Ray : Newsgroups : povray.off-topic : OO theory? Python. : Re: OO theory? Python. Server Time
29 Jul 2024 04:19:50 EDT (-0400)
  Re: OO theory? Python.  
From: Warp
Date: 22 Oct 2012 09:53:59
Message: <50854ff7@news.povray.org>
Darren New <dne### [at] sanrrcom> 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.

> 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?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.