[BangPypers] problem with python classes

hiharry danny hrdspl at gmail.com
Thu May 9 17:41:17 CEST 2013


i have python 2.7.4......now suppose i have two new-style base classes ,
i.e. class ClassName(object):
and the two base classes are related by __init__ constructor where the
__init__ constructor of one base class is accessed by the __init property
of the other base class , for example :

class ClassOne(object):
        def __init__(self,value):
              self.value = value

class ClassTwo(object):
         def __init__(self,inputvalues):
                self.values = []
                 for i in inputvalues:
                     self.values.append(ClassOne(inputvalues))

if this be the case , then without using inheritance property of OOP ,i,e,
without creating further new subclasses , how can I access other user
defined methods of ClassOne class via Class Two class. The ouput value will
be returned by a user defined method of ClassTwo but the computation will
be done by a method of ClassOne which is called by the user defined method
of class two ...?

so what will be the solution ?


More information about the BangPypers mailing list