How python interpreter determine the type of variable at runtime? -


i want know how python's (python 2.7) interpreter find type of variable. how python dynamic type behaviour internally works.

macbook-pro:~ neelabhsingh$ python python 2.7.12 (default, jun 29 2016, 14:05:02) >>> type(i) <type 'int'> >>> type(str1) <type 'str'> >>> testfloat = 45.67 >>> type(testfloat) <type 'float'> 

in cpython 2.7 (i.e. c language implementation of python), there pyobject type. there pyobject_type function accesses type stored in pyobject i.e. object carries around type information it.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -