Skip to content

Commit

Permalink
remediation and history entry for genconverter inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Gaultney authored and Tinche committed Jan 25, 2021
1 parent 3f28edc commit e54fa17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ History
* ``converter.unstructure`` now supports an optional parameter, `unstructure_as`, which can be used to unstructure something as a different type. Useful for unions.
* Improve support for union un/structuring hooks. Flesh out docs for advanced union handling.
(`#115 <https://github.com/Tinche/cattrs/pull/115>`_)
* Fix `GenConverter` behavior with inheritance hierarchies of `attrs` classes.
(`#117 <https://github.com/Tinche/cattrs/pull/117>`_) (`#116 <https://github.com/Tinche/cattrs/issues/116>`_)

1.1.2 (2020-11-29)
------------------
Expand Down
4 changes: 2 additions & 2 deletions src/cattr/multistrategy_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MultiStrategyDispatch(object):
)

def __init__(self, fallback_func):
self._direct_dispatch = dict()
self._direct_dispatch = {}
self._function_dispatch = FunctionDispatch()
self._function_dispatch.register(lambda _: True, fallback_func)
self._single_dispatch = singledispatch(_DispatchNotFound)
Expand All @@ -41,7 +41,7 @@ def __init__(self, fallback_func):
def _dispatch(self, cl):
try:
direct_dispatch = self._direct_dispatch.get(cl)
if direct_dispatch:
if direct_dispatch is not None:
return direct_dispatch
dispatch = self._single_dispatch.dispatch(cl)
if dispatch is not _DispatchNotFound:
Expand Down

0 comments on commit e54fa17

Please sign in to comment.