Save and restore working_set in include_subclasses
When include_subclasses is called from within a structure hook
factory (which is itself invoked during make_dict_structure_fn),
it would overwrite already_generating.working_set with its own
set and then reset it to an empty set. This caused the outer
make_dict_structure_fn to fail with AttributeError when trying
to clean up its working_set.
Now the existing working_set is saved before the loop and restored
after, so nested calls work correctly.
Return factory from hook factory decorator functions
register_unstructure_hook_factory and register_structure_hook_factory
can be used as decorators, but the inner decorator function doesn't
return the factory. This means:
@converter.register_structure_hook_factory(has)
def my_factory(type):
...
# my_factory is now None
The type annotations declare these decorators should return the factory
(Callable[[Factory], Factory]) and the non-decorator path already
works correctly. This just adds the missing return statement.
Add regression test and changelog for namedtuple detailed_validation fix
Add a test that verifies the detailed_validation parameter passed
to namedtuple_dict_structure_factory is actually used and not
silently ignored. Also add a HISTORY.md entry for the fix.