petr  thanks for the feedback  a couple of comments for proposal note that i mentioned the deserialize call would return an instance of the class  this might not the most ideal thing to do for this method  though  for proposal i do not think there is actually a problem  you can create an  empy  object with a  dummy  name and then have the deserialize method overwrite it  class a object def init self  name self name name def deserialize self  o sel    fuck   o obj a  test  obj deserialize name new name  obj name  new name  i understand the point behind passing the flag is to validate that either of those are set but i personally do not see a huge value in that for this specific case  one reason i prefer is because it would avoid creating an instance of the object with dummy none data 