Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ead3362

Browse files
committed
Introspection
1 parent 05ea5c0 commit ead3362

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ Introspection
21412141
### Attributes
21422142
```python
21432143
<list> = dir(<object>) # Names of object's attributes (incl. methods).
2144-
<dict> = vars(<object>) # Dict of writable attrs. Also <obj>.__dict__.
2144+
<dict> = vars(<object>) # Dict of writable attributes. Also <obj>.__dict__.
21452145
<bool> = hasattr(<object>, '<attr_name>') # Checks if getattr() raises an AttributeError.
21462146
value = getattr(<object>, '<attr_name>') # Raises AttributeError if attribute is missing.
21472147
setattr(<object>, '<attr_name>', value) # Only works on objects with __dict__ attribute.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@
19051905

19061906

19071907
<div><h3 id="attributes-1">Attributes</h3><pre><code class="python language-python hljs">&lt;list&gt; = dir(&lt;object&gt;) <span class="hljs-comment"># Names of object's attributes (incl. methods).</span>
1908-
&lt;dict&gt; = vars(&lt;object&gt;) <span class="hljs-comment"># Dict of writable attrs. Also &lt;obj&gt;.__dict__.</span>
1908+
&lt;dict&gt; = vars(&lt;object&gt;) <span class="hljs-comment"># Dict of writable attributes. Also &lt;obj&gt;.__dict__.</span>
19091909
&lt;bool&gt; = hasattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>) <span class="hljs-comment"># Checks if getattr() raises an AttributeError.</span>
19101910
value = getattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>) <span class="hljs-comment"># Raises AttributeError if attribute is missing.</span>
19111911
setattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>, value) <span class="hljs-comment"># Only works on objects with __dict__ attribute.</span>

0 commit comments

Comments
 (0)