 just a suggestion  you can keep it as it is  since i do not see a big difference either way  but  i agree with the the aesthetic appeal of keeping fields and their types together  other than that  i am not convinced  i do not see why you need to inspect this object at all  i do not see the advantage of this over something as   dumb   as class ntbparameters object def init self  w length  bm ntb formats supported self w length w length self bm ntb formats supported bm ntb formats supported classmethod def get format string cls return  hhihih  since you do not have a functions to automatically pack unpack this object  i do not see why you need to be able to access the object attributes using strings  so  i do not understand why you need to use inspect setattr  