We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdc534d commit 1536601Copy full SHA for 1536601
1 file changed
src/cattrs/gen/__init__.py
@@ -551,6 +551,12 @@ def make_dict_structure_fn_from_attrs(
551
# The first loop deals with required args.
552
for a in attrs:
553
an = a.name
554
+
555
+ if a.default is not NOTHING:
556
+ non_required.append(a)
557
+ # The next loop will handle it.
558
+ continue
559
560
if an in kwargs:
561
override = kwargs[an]
562
else:
@@ -562,9 +568,7 @@ def make_dict_structure_fn_from_attrs(
568
continue
563
569
if override.omit is None and not a.init and not _cattrs_include_init_false:
564
570
565
- if a.default is not NOTHING:
566
- non_required.append(a)
567
- continue
571
572
t = a.type
573
if isinstance(t, TypeVar):
574
t = typevar_map.get(t.__name__, t)
0 commit comments