File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -547,7 +547,18 @@ Python 3.
547547 host introspection through the sys and os modules.
548548
549549
550- ### [ ] ( )
550+ ### [ Item 55: Use repr strings for debugging output] ( item_55_use_repr_strings.py )
551+ - 1 . Calling print on built-in Python types will produce the human-readable
552+ string version of a value, which hides type information.
553+ - 2 . Calling repr on built-in Python types will produce the printable string
554+ version of a value. These repr strings could be passed to the eval
555+ built-in function to get back the original value.
556+ - 3 . %s in format strings will produce human-readable strings like str.%r will
557+ produce printable strings like repr.
558+ - 4 . You can define the __ repr__ method to customize the printable
559+ representation of a class and provide more detailed debugging
560+ information.
561+ - 5 . You can reach into any object's __ dict__ attribute to view its internals.
551562
552563
553564### [ ] ( )
You can’t perform that action at this time.
0 commit comments