Skip to content

Commit e095605

Browse files
committed
Pprint and vars
1 parent f0bc619 commit e095605

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ String
244244
print(<el_1> [, <el_2>, end='', sep='', file=<file>]) # Use 'file=sys.stderr' for errors.
245245
```
246246

247+
#### Pprint:
248+
```python
249+
>>> from pprint import pprint
250+
>>> pprint(locals())
251+
{'__doc__': None,
252+
'__name__': '__main__',
253+
'__package__': None, ...
254+
}
255+
```
256+
247257

248258
Regex
249259
-----
@@ -979,6 +989,9 @@ Introspection and Metaprograming
979989
```
980990

981991
```python
992+
>>> vars(z)
993+
{'a': 'abcde', 'b': 12345}
994+
982995
>>> getattr(z, 'a') # Same as Z.__getattribute__(z, 'a')
983996
'abcde'
984997

0 commit comments

Comments
 (0)