On 2 April 2013 14:27, Fabian PyDEV wrote:
> Hi All,
>
> I have a question.
>
> Let says I have the following two classes:
>
> class Base(object):
> __mylist__ = ["value1", "value2"]
>
> def somemethod(self):
> pass
>
>
> class Derived(Base):
> __mylist__ =
On 04/02/2013 09:27 AM, Fabian PyDEV wrote:
Hi All,
I have a question.
Let says I have the following two classes:
class Base(object):
__mylist__ = ["value1", "value2"]
def somemethod(self):
pass
class Derived(Base):
__mylist__ = ["value3", "value4"]
Hi All,
I have a question.
Let says I have the following two classes:
class Base(object):
__mylist__ = ["value1", "value2"]
def somemethod(self):
pass
class Derived(Base):
__mylist__ = ["value3", "value4"]
def anothermethod(self):
Andrea Crotti wrote:
> I wanted to add a couple of parameters to a class from a given library
> (paste-script), but without changing the original code.
> So I thought, I create a wrapper class which adds what I need, and then
> dispatch all the calls to the super class.
You don't need to use a wr
Jean-Michel Pichavant writes:
> Did you consider subclassing your Var class ? This is how you extend a
> class behavior in OOP.
>
> class PSIVar(var):
>def __init__(self, name, desc, other=None, fun=None):
>var.__init__(self, name, desc)
>if other is not None:
>sel
Andrea Crotti wrote:
On 09/23/2011 10:31 AM, Peter Otten wrote:
Inside __getattribute__() you ask for self.first_var which triggers
another
__getattribute__() call that once again trys to determine the first_var
attribute before it returns...
Try using __getattr__() instead which is only tri
On 09/23/2011 10:31 AM, Peter Otten wrote:
Inside __getattribute__() you ask for self.first_var which triggers another
__getattribute__() call that once again trys to determine the first_var
attribute before it returns...
Try using __getattr__() instead which is only triggered for non-existent
Andrea Crotti wrote:
> I wanted to add a couple of parameters to a class from a given library
> (paste-script), but without changing the original code.
> So I thought, I create a wrapper class which adds what I need, and then
> dispatch all the calls to the super class.
>
> My following attempt g
I wanted to add a couple of parameters to a class from a given library
(paste-script), but without changing the original code.
So I thought, I create a wrapper class which adds what I need, and then
dispatch all the calls to the super class.
My following attempt gives, however, a recursion erro