Re: Function Overloading and Python

2008-03-02 Thread castironpi
On Feb 25, 11:04 am, [EMAIL PROTECTED] wrote: > > B1.fun(A(x), A(y), A(z)) == B.fun(A(x), A(y), A(z)) > > but > > B1.fun(A1(x), A(y), A(z) != B.fun(A1(x), A(y), A(z)) > > > Is there a data-structure solution or third party module that would > > mimic this behavior? > > class B: >    xfun= Overloade

Re: Function Overloading and Python

2008-02-25 Thread castironpi
> B1.fun(A(x), A(y), A(z)) == B.fun(A(x), A(y), A(z)) > but > B1.fun(A1(x), A(y), A(z) != B.fun(A1(x), A(y), A(z)) > > Is there a data-structure solution or third party module that would > mimic this behavior? ''' An Overloaded instance, B.xfun, is created in the base class of the classes the memb

Re: Function Overloading and Python

2008-02-25 Thread castironpi
On Feb 25, 1:33 am, Allen Peloquin <[EMAIL PROTECTED]> wrote: > I have a personal project that has an elegant solution that requires > both true multiple inheritance of classes (which pretty much limits my > language choices to C++ and Python) and type-based function > overloading. > > Now, while t

Re: Function Overloading and Python

2008-02-25 Thread Carl Banks
On Feb 25, 2:33 am, Allen Peloquin <[EMAIL PROTECTED]> wrote: > I have a personal project that has an elegant solution that requires > both true multiple inheritance of classes (which pretty much limits my > language choices to C++ and Python) and type-based function > overloading. > > Now, while t

Re: Function Overloading and Python

2008-02-25 Thread Gerald Klix
Stefan Behnel schrieb: > Allen Peloquin wrote: >> On Feb 24, 11:44 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: >>> Allen Peloquin wrote: class B { fun(A x, A y, A z)... fun(A1 x, A y, A z)... } class B1 { fun(A1 x, A y, A z)... } Such t

Re: Function Overloading and Python

2008-02-25 Thread Bruno Desthuilliers
Allen Peloquin a écrit : > I have a personal project that has an elegant solution that requires > both true multiple inheritance of classes (which pretty much limits my > language choices to C++ and Python) and type-based function > overloading. > > Now, while this makes it sound like I have to re

Re: Function Overloading and Python

2008-02-25 Thread Stefan Behnel
Allen Peloquin wrote: > On Feb 24, 11:44 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Allen Peloquin wrote: >>> class B >>> { >>> fun(A x, A y, A z)... >>> fun(A1 x, A y, A z)... >>> } >>> class B1 >>> { >>> fun(A1 x, A y, A z)... >>> } >>> Such that any previous behavior is inherite

Re: Function Overloading and Python

2008-02-24 Thread Paul Rudin
Allen Peloquin <[EMAIL PROTECTED]> writes: > I have a personal project that has an elegant solution that requires > both true multiple inheritance of classes (which pretty much limits my > language choices to C++ and Python) and type-based function > overloading. > Common Lisp :/ -- http://mail

Re: Function Overloading and Python

2008-02-24 Thread Allen Peloquin
On Feb 24, 11:44 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Allen Peloquin wrote: > > class B > > { > > fun(A x, A y, A z)... > > fun(A1 x, A y, A z)... > > } > > > class B1 > > { > > fun(A1 x, A y, A z)... > > } > > > Such that any previous behavior is inherited, but behaves > > po

Re: Function Overloading and Python

2008-02-24 Thread Stefan Behnel
Stefan Behnel wrote: > Allen Peloquin wrote: >> class B >> { >> fun(A x, A y, A z)... >> fun(A1 x, A y, A z)... >> } >> >> class B1 >> { >> fun(A1 x, A y, A z)... >> } >> >> Such that any previous behavior is inherited, but behaves >> polymorphically because of the single function name.

Re: Function Overloading and Python

2008-02-24 Thread Stefan Behnel
Allen Peloquin wrote: > class B > { > fun(A x, A y, A z)... > fun(A1 x, A y, A z)... > } > > class B1 > { > fun(A1 x, A y, A z)... > } > > Such that any previous behavior is inherited, but behaves > polymorphically because of the single function name. Try something like this: class

Function Overloading and Python

2008-02-24 Thread Allen Peloquin
I have a personal project that has an elegant solution that requires both true multiple inheritance of classes (which pretty much limits my language choices to C++ and Python) and type-based function overloading. Now, while this makes it sound like I have to resign myself to C++, which I am not a