| 238 | |
| 239 | |
| 240 | class PrintContainer: |
| 241 | def __init__(self): |
| 242 | self.value = "" |
| 243 | |
| 244 | def append(self, text): |
| 245 | self.value += text |
| 246 | return self |
| 247 | |
| 248 | def __iadd__(self, other): |
| 249 | """Implements the += operator""" |
| 250 | self.value += str(other) |
| 251 | return self |
| 252 | |
| 253 | def __str__(self): |
| 254 | """String representation""" |
| 255 | return self.value |
| 256 | |
| 257 | def __repr__(self): |
| 258 | """Representation for debugging""" |
| 259 | return f"PrintContainer({self.value})" |
| 260 | |
| 261 | def __len__(self): |
| 262 | """Implements len() function support""" |
| 263 | return len(self.value) |
| 264 | |
| 265 | |
| 266 | class BreakException(Exception): |
no outgoing calls
searching dependent graphs…