mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 15:41:26 +07:00
(cherry picked from commit 359b9a41515da9a841aad787695dee4ed14a12f5) GitOrigin-RevId: 76a2706e3175e2cd8768b2c7882c3506120a82cb
22 lines
617 B
HTML
22 lines
617 B
HTML
<html>
|
|
<body>
|
|
<p>Reports when a type that doesn't define <code>__str__</code>, <code>__repr__</code>, or <code>__format__</code>
|
|
is converted to a string. The default string representation may not be useful for debugging or display purposes.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class A:
|
|
pass
|
|
|
|
str(A()) # Result: "<__main__.A object at 0x...>"
|
|
</code></pre>
|
|
<p>Consider defining one of these methods to provide a meaningful string representation:</p>
|
|
<pre><code>
|
|
class A:
|
|
def __str__(self):
|
|
return "A instance"
|
|
|
|
def __repr__(self):
|
|
return "A()"
|
|
</code></pre>
|
|
</body>
|
|
</html> |