I know about writing programs(using C) that have:
1) Data values, that are manipulated. For example: integer, float values etc..
2) functions(rules), by which data values are manipulated.
object is a coherent abstraction that encompass it's properties(data values) + interactions(functions) && processes(functions) that can manipulate those data values.
As a python beginner, I would like to know, Why data values like integers and floats are considered objects?
From Guido's blog as mentioned below, I could find some relevant information but does not answer why?
The internal implementation of Python made this simple to do. All of Python's objects were based on a common C data structure that was used everywhere in the interpreter. Variables, lists, functions, and everything else just used variations of this one data structure---it just didn't matter if the structure happened to represent a simple object such as an integer or something more complicated such as a class.
Aucun commentaire:
Enregistrer un commentaire