File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,22 @@ class <name>:
902
902
* ** Return value of repr() should be unambiguous and of str() readable.**
903
903
* ** If only repr() is defined, it will also be used for str().**
904
904
905
+ #### Str() is used by:
906
+ ``` python
907
+ print (< el> )
908
+ f ' { < el> } '
909
+ raise Exception (< el> )
910
+ logging.debug(< el> )
911
+ ```
912
+
913
+ #### Repr() is used by:
914
+ ``` python
915
+ print ([< el> ])
916
+ f ' { < el> !r } '
917
+ >> > < el>
918
+ loguru.logger.exception()
919
+ ```
920
+
905
921
### Constructor Overloading
906
922
``` python
907
923
class < name> :
Original file line number Diff line number Diff line change @@ -855,6 +855,18 @@ <h2 id="class"><a href="#class" name="class">#</a>Class</h2>
855
855
< li > < strong > Return value of repr() should be unambiguous and of str() readable.</ strong > </ li >
856
856
< li > < strong > If only repr() is defined, it will also be used for str().</ strong > </ li >
857
857
</ ul >
858
+ < h4 id ="strisusedby "> Str() is used by:</ h4 >
859
+ < pre > < code class ="python language-python hljs "> print(<el>)
860
+ < span class ="hljs-string "> f'< span class ="hljs-subst "> {<el>}</ span > '</ span >
861
+ < span class ="hljs-keyword "> raise</ span > Exception(<el>)
862
+ logging.debug(<el>)
863
+ </ code > </ pre >
864
+ < h4 id ="reprisusedby "> Repr() is used by:</ h4 >
865
+ < pre > < code class ="python language-python hljs "> print([<el>])
866
+ < span class ="hljs-string "> f'< span class ="hljs-subst "> {<el>!r}</ span > '</ span >
867
+ < span class ="hljs-meta "> >>> </ span > <el>
868
+ loguru.logger.exception()
869
+ </ code > </ pre >
858
870
< h3 id ="constructoroverloading "> Constructor Overloading</ h3 >
859
871
< pre > < code class ="python language-python hljs "> < span class ="hljs-class "> < span class ="hljs-keyword "> class</ span > << span class ="hljs-title "> name</ span > >:</ span >
860
872
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __init__</ span > < span class ="hljs-params "> (self, a=None)</ span > :</ span >
You can’t perform that action at this time.
0 commit comments