| Conditions | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | |||
| 15 | def this_str(self): |
||
| 16 | import pprint |
||
| 17 | fmt = 'StarTuple: <{0}>\n'.format(str(name)) |
||
| 18 | |||
| 19 | len_of_keys = 0 |
||
| 20 | for key in self._asdict().keys(): |
||
| 21 | if len(key) > len_of_keys: |
||
| 22 | len_of_keys = len(key) |
||
| 23 | |||
| 24 | for key, value in self._asdict().items(): |
||
| 25 | fmt += (' {key:%d}: {value}\n' % len_of_keys).format( |
||
| 26 | key=key, |
||
| 27 | value=pprint.pformat(value, width=150), |
||
| 28 | ) |
||
| 29 | |||
| 30 | return fmt |
||
| 31 | |||
| 37 |
Prefixing a member variable
_is usually regarded as the equivalent of declaring it with protected visibility that exists in other languages. Consequentially, such a member should only be accessed from the same class or a child class: