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
<dict> = vars(<object>) <spanclass="hljs-comment"># Dict of object's fields. Also <obj>.__dict__.</span>
1909
-
<bool> = hasattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Checks if getattr() raises an error.</span>
1908
+
<dict> = vars(<object>) <spanclass="hljs-comment"># Dict of writable attrs. Also <obj>.__dict__.</span>
1909
+
<bool> = hasattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Checks if getattr() raises an AttributeError.</span>
1910
1910
value = getattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Raises AttributeError if attribute is missing.</span>
1911
1911
setattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>, value) <spanclass="hljs-comment"># Only works on objects with __dict__ attribute.</span>
1912
1912
delattr(<object>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Equivalent to `del <object>.<attr_name>`.</span>
0 commit comments