Commit c1e93e9
Use the un-underscored name if no alias attribute is there. (#416)
* Simplify code as cattrs depends on modern attrs
This modern version of `attrs` provides the `alias` attribute on
fields that contains the name we should use here.
Also add a test to verify that structuring and unstructuring aliased
attributes (which can be triggered by prefixing an attribute with an
underscore) works as expected.
* Tweak test
---------
Co-authored-by: Tin Tvrtković <[email protected]>1 parent c447dfe commit c1e93e9
3 files changed
+22
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
513 | | - | |
514 | 512 | | |
515 | | - | |
| 513 | + | |
516 | 514 | | |
517 | 515 | | |
518 | 516 | | |
519 | | - | |
520 | | - | |
521 | | - | |
| 517 | + | |
522 | 518 | | |
523 | 519 | | |
524 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
384 | 401 | | |
385 | 402 | | |
386 | 403 | | |
| |||
0 commit comments