'spama it' an integer now it' string now it' floating point this isn' typical python codebut it does work-- starts out as an integerthen becomes stringand finally becomes floating-point number this example tends to look especially odd to ex- programmersas it appears as though the type of changes from integer to string when we say 'spamhoweverthat' not really what' happening in pythonthings work more simply names have no typesas stated earliertypes live with objectsnot names in the preceding listingwe've simply changed to reference different objects because variables have no typewe haven' actually changed the type of the variable awe've simply made the variable reference different type of object in factagainall we can ever say about variable in python is that it references particular object at particular point in time objectson the other handknow what type they are--each object contains header field that tags the object with its type the integer object for examplewill contain the value plus designator that tells python that the object is an integer (strictly speakinga pointer to an object called intthe name of the integer typethe type designator of the 'spamstring object points to the string type (called strinstead because objects know their typesvariables don' have to to recaptypes are associated with objects in pythonnot with variables in typical codea given variable usually will reference just one kind of object because this isn' requirementthoughyou'll find that python code tends to be much more flexible than you may be accustomed to--if you use python wellyour code might work on many types automatically mentioned that objects have two header fieldsa type designator and reference counter to understand the latter of thesewe need to move on and take brief look at what happens at the end of an object' life objects are garbage-collected in the prior section' listingswe assigned the variable to different types of objects in each assignment but when we reassign variablewhat happens to the value it was previously referencingfor exampleafter the following statementswhat happens to the object 'spamthe answer is that in pythonwhenever name is assigned to new objectthe space held by the prior object is reclaimed if it is not referenced by any other name or object this automatic reclamation of objectsspace is known as garbage collectionand makes life much simpler for programmers of languages like python that support it the dynamic typing interlude