2

Concider following example:

from collections import OrderedDict

class AnyAbstract:
    #__dict__ = OrderedDict()#not working?

    def classFields(self):
        return  {(key,value) for key,value in self.__class__.__dict__.items() if not 
    key.startswith("__") }




    class Dummy(AnyAbstract):
        value = int
        name = str
        adress =float

        def __init__(self):
            self.__class__.__dict__ = OrderedDict()  # not working?

What i am trying to do here,is to store some information in the class variables, what a subclass will have, but for making it work, i need some method what would list the arguments in the direction they are written in class body, means value, name, address here.

My ideas about assigning to class !! dict to be Ordered Dict, is not working. Maybe you know some inspection tools for that?

Many thanks

user184868
  • 193
  • 9

0 Answers0