2

Little question: are int, float, bool, list, str, etc. actual classes in python? For example, if we write x = 5 we create an instance of a class int and assign this instance to a variable x. Am I correct?

trollpidor
  • 447
  • 5
  • 11
  • 1
    Yes, that's correct (except that small integers are *interned* in CPython, so `x = 5` would assign an existing `int` instance to the identifier `x`). – jonrsharpe May 13 '15 at 21:20
  • Please take a look in the Python documentation: https://docs.python.org/2/library/stdtypes.html#built-in-types – alfakini May 13 '15 at 21:23

0 Answers0