You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1882,7 +1882,7 @@
1882
1882
1883
1883
<pre><codeclass="python language-python hljs"><bool> = hasattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Checks if getattr() raises an error.</span>
1884
1884
value = getattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Raises AttributeError if attribute is missing.</span>
1885
-
setattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>, value) <spanclass="hljs-comment"># Only works on classes with __dict__ attribute.</span>
1885
+
setattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>, value) <spanclass="hljs-comment"># Only works on objects with __dict__ attribute.</span>
1886
1886
delattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Equivalent to `del <object>.<attr_name>`.</span>
0 commit comments