Skip to content

Commit e5a51a4

Browse files
committed
Small tweaks
1 parent 33c8fe6 commit e5a51a4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/cattr/dispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _dispatch(self, cl):
4949
return self._function_dispatch.dispatch(cl)
5050

5151
def register_cls_list(self, cls_and_handler, direct: bool = False):
52-
"""register a class to direct or singledispatch"""
52+
"""Register a class to direct or singledispatch."""
5353
for cls, handler in cls_and_handler:
5454
if direct:
5555
self._direct_dispatch[cls] = handler

src/cattrs/gen.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,12 @@ def make_dict_structure_fn(
379379
else:
380380
handler = converter.structure
381381

382-
struct_handler_name = f"__c_structure_{an}"
383-
internal_arg_parts[struct_handler_name] = handler
384-
385382
kn = an if override.rename is None else override.rename
386383
allowed_fields.add(kn)
387384

388385
if handler:
386+
struct_handler_name = f"__c_structure_{an}"
387+
internal_arg_parts[struct_handler_name] = handler
389388
if handler == converter._structure_call:
390389
internal_arg_parts[struct_handler_name] = t
391390
invocation_lines.append(

0 commit comments

Comments
 (0)