>724275 Textdarstellungen von Python -Objekten
Text representations of Python objects
It is not possible to output an object directly, because an object is not text. For this reason, in order to output an object, a text representation of the object is created. This text representation is a text representing the object and can then be output. The process of the production of a text representation will also be called text representation.
When an expression is entered into the console, it is being evaluated. After the evaluation of the entered expression, a text representation of the object obtained is output.
- Evaluation in the console
- "Hello, world!"↵
'Hello, world!'
The expression »"Hello, world!"« is evaluated above. The evaluation results in an object. The text representation of that object is then »'Hello, world!'«.
The text representation of an object is normally used whenever this object is to be output on a text medium.
- Evaluation of the expression »"Hello, world!"« and text representation of the object obtained
evaluation text representation
"Hello, world!" --------------------> Hello, world! -------------------------> 'Hello, world!'
Expression object text representationa text not a text a text
- Evaluation of an expression with subsequent text representation of the object obtained
evaluation text representation
expression --------------------> object ---------------------> text representation
A text representation of an object often does not contain all information about the object.
The term “text representation of an object ” belongs to the run-time model.