Browse Source

Format, Decorator, Class

pull/10/head
Jure Šorn 6 years ago
parent
commit
1faec76fe9
1 changed files with 3 additions and 2 deletions
  1. 5
      README.md

5
README.md

@ -338,10 +338,10 @@ Format
``` ```
### String Options ### String Options
**`'!r'` calls object's repr() method, instead of format(), to get a string.**
```python ```python
{'abcde'!r:<10} # "'abcde' " {'abcde'!r:<10} # "'abcde' "
``` ```
* **`'!r'` calls object's repr() method, instead of format(), to get a string.**
```python ```python
{'abcde':.3} # 'abc' {'abcde':.3} # 'abc'
@ -703,7 +703,8 @@ class Employee(Person):
``` ```
### Comparable ### Comparable
**If eq() method is not overridden, it returns `'id(self) == id(other)'`, which is the same as `'self is other'`, meaning all objects compare not equal by default.** * **If eq() method is not overridden, it returns `'id(self) == id(other)'`, which is the same as `'self is other'`,**
* **meaning all objects compare not equal by default.**
```python ```python
class MyComparable: class MyComparable:

|||||||
100:0
Loading…
Cancel
Save