Commit 6a98a8e
Improve string representations of
Instead of for example {'nodes_created': 42, 'labels_removed': 0, '_contains_system_updates': True} the `repr` string representation is now SummaryCounters({'nodes-created': 42, 'labels-removed': 0, 'contains-system-updates': True}) or similar. This is more in line with Python's recommendations: > If at all possible, this should look like a valid Python expression that > could be used to recreate an object with the same value (given an appropriate > environment). If this is not possible, a string of the form > <...some useful description...> should be returned. > > -- https://docs.python.org/3/reference/datamodel.html#object.__repr__ Further, the `str` representation has been adjusted from for instance {'nodes_created': 42, 'labels_removed': 0, '_contains_system_updates': True} to SummaryCounters{nodes_created: 42, contains_updates: True, contains_system_updates: True} representing all non-default attributes/properties of the object. Co-authored-by: Max Gustafsson <61233757+MaxAake@users.noreply.github.com>SummaryCounters (#1233)1 parent 54dc5db commit 6a98a8e
File tree
3 files changed
+574
-19
lines changed- src/neo4j/_work
- tests/unit/common/work
3 files changed
+574
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
333 | 355 | | |
334 | 356 | | |
335 | 357 | | |
| |||
373 | 395 | | |
374 | 396 | | |
375 | 397 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | 398 | | |
393 | | - | |
| 399 | + | |
394 | 400 | | |
395 | 401 | | |
396 | 402 | | |
397 | 403 | | |
398 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
399 | 425 | | |
400 | 426 | | |
401 | 427 | | |
| |||
0 commit comments