Skip to content

Dispatch walks mro for lazily registered handlers - #8185

Merged
jsignell merged 1 commit into
dask:mainfrom
jcrist:register-lazy-walks-mro
Sep 27, 2021
Merged

jsignell merged 1 commit into
dask:mainfrom
jcrist:register-lazy-walks-mro

Conversation

@jcrist

@jcrist jcrist commented Sep 27, 2021 •

Copy link
Copy Markdown
Member

Previously when Dispatch walked the mro of a class, it would only
look for eagerly registered handlers (instead of lazily registered
handlers). This meant that subclasses of lazily registered handlers
would only be used when dispatching on a subclass if the parent class
had been dispatched on earlier (this triggering the registration).

This patch fixes this to check for lazily registered handlers when
walking the mro. This results in negligible slowdown during the fast
path.

Fixes #8111.

  • Closes #xxxx
  • Tests added / passed
  • Passes black dask / flake8 dask / isort dask

Previously when `Dispatch` walked the `mro` of a class, it would only
look for eagerly registered handlers (instead of lazily registered
handlers). This meant that subclasses of lazily registered handlers
would only be used when dispatching on a subclass if the parent class
had been dispatched on earlier (this triggering the registration).

This patch fixes this to check for lazily registered handlers when
walking the mro. This results in negligible slowdown during the fast
path.

Fixes dask#8111.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent Tokenization due to Lazy Registration

2 participants