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

Fix and refactor get_all_subclasses() util in shampoo_types_test.py #75

Closed

Conversation

tsunghsienlee
Copy link
Contributor

Summary:

  1. Fixes the bug that recursive function did not include that cls itself into the return result.
  2. Adds a new argument include_cls_self to the function to control whether to include the class itself in the result. It also includes docstrings to explain how this function works.

Differential Revision: D67802249

Summary:
1. Fixes the bug that recursive function did not include that `cls` itself into the return result.
2. Adds a new argument `include_cls_self` to the function to control whether to include the class itself in the result. It also includes docstrings to explain how this function works.

Differential Revision: D67802249
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 3, 2025
@tsunghsienlee tsunghsienlee requested a review from runame January 3, 2025 18:16
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67802249

Copy link
Contributor

@runame runame left a comment

Choose a reason for hiding this comment

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

I don't think this was a bug before, but the refactor makes sense to me.

@tsunghsienlee
Copy link
Contributor Author

I don't think this was a bug before, but the refactor makes sense to me.

In fact, it was a bug because the recursive traversal will return a empty set always; this was discovered after I examined the coverage report.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c51e4e6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants