We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83a6ee2 commit e40d97cCopy full SHA for e40d97c
README.md
@@ -1391,25 +1391,10 @@ Introspection and Metaprograming
1391
1392
### Attributes
1393
```python
1394
-class Z:
1395
- def __init__(self):
1396
- self.a = 'abcde'
1397
- self.b = 12345
1398
-```
1399
-
1400
-```python
1401
->>> z = Z()
1402
1403
->>> vars(z)
1404
-{'a': 'abcde', 'b': 12345}
1405
1406
->>> getattr(z, 'a')
1407
-'abcde'
1408
1409
->>> hasattr(z, 'c')
1410
-False
1411
1412
->>> setattr(z, 'c', 10)
+<dict> = vars(<object>)
+<bool> = hasattr(<object>, '<attr_name>')
+value = getattr(<object>, '<attr_name>')
+setattr(<object>, '<attr_name>', value)
1413
```
1414
1415
### Parameters
0 commit comments