Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazy_isinstance(): use .__class__ for type checking #6974

Merged
merged 1 commit into from
May 21, 2021

Conversation

madsbk
Copy link
Contributor

@madsbk madsbk commented May 20, 2021

In order to support object wrappers/proxies like weakref.proxy and rapidsai/dask-cuda#451, this PR implements type checking using x.__class__ instead of type(x).

This PR shouldn't change any semantic other than the support of proxies.

We did something similar in Dask, for a detailed discussion of the difference between __class__ and type see dask/dask#6981

This change is motivated by rapidsai/dask-cuda#610

cc @trivialfis @VibhuJawa

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Good to learn about the difference between these cases.

Please ignore the CI for now. We will handle it.

@trivialfis trivialfis merged commit 81bdfb8 into dmlc:master May 21, 2021
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.

2 participants