title: How do I determine the size of an object in Python?
body: <p>I want to know how to get size of objects like a string, integer, etc. in Python.</p>
  
  <p>Related question: <a href="https://stackoverflow.com/questions/135664/how-many-bytes-per-element-are-there-in-a-python-list-tuple">How many bytes per element are there in a Python list (tuple)?</a></p>
  
  <p>I am using an XML file which contains size fields that specify the size of value. I must parse this XML and do my coding. When I want to change the value of a particular field, I will check the size field of that value. Here I want to compare whether the new value that I'm gong to enter is of the same size as in XML. I need to check the size of new value. In case of a string I can say its the length. But in case of int, float, etc. I am confused.</p>