confused about the different built-in functions in Python

Marko Rauhamaa marko at pacujo.net
Mon May 26 15:00:21 EDT 2014


Terry Reedy <tjreedy at udel.edu>:

> Part of the answer is Python's history. Up to about 2.1, most built-in
> types did not have methods, though I know lists did. Ints and strings
> did not, or chr and ord might have been int.chr() and str.ord(). (The
> current string methods were originally functions in the string
> module.)

Ints still aren't quite like regular objects. For example:

   >>> x = 500
   >>> x.__str__ is x.__str__
   False


Marko



More information about the Python-list mailing list