Class Methods
William Tanksley
wtanksle at dolphin.openprojects.net
Fri Apr 20 22:11:25 EDT 2001
On Fri, 20 Apr 2001 11:34:08 -0600, Rainer Deyke wrote:
>I consider classes/instances a special case of namespaces: one which allows
>(multiple) instantiation and inheritance.
Sounds reasonable. BTW, have you checked out the way Sather handles
importation versus inheritance?
>operator overloading? Don't name your function '__add__' then."). The
>resulting programming language might look something like this:
>namespace A: # Create a named unique object
> pass
>namespace B(A): # Similar to 'from ... import', but done through linking
> # instead of copying
>class C(A): # 'class' = namespace that requires/supports instantiation
> # class inherits from namespace => functions in namespace
> # are treated as "static" functions
> pass
>namespace D(C()): # namespace inherits from instance of class
> pass
Mine would look similar, except that in addition to Python's inheritance
operator
namespace C(A):
pass
I'd also provide a Sather interface operator and a Sather import operator:
namespace C<A>:
from <A> import *
(Using a Sather interface AND a Sather from...import* adds up to the same
thing as using a Python inheretance; the difference is when you use
specific Sather imports to get exactly what you want.)
>Rainer Deyke (root at rainerdeyke.com)
--
-William "Billy" Tanksley
More information about the Python-list
mailing list