-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add suggestion to enumerate ModuleDict in error message #41946
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
Add suggestion to enumerate ModuleDict in error message #41946
Conversation
0d6608d to
203e62b
Compare
eellison
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice change
| << "Unable to extract string literal index. ModuleDict indexing is only supported with string literals."; | ||
| << "Unable to extract string literal index. " | ||
| << "ModuleDict indexing is only supported with string literals. " | ||
| << "Enumeration of ModuleDict is supported, e.g. 'for m in self.values(): ...'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe for k, v in self.items() maybe bc it's more general
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wconstab has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Follow up to #41946, to suggest enumerating a module as an alternative if a user tries indexing into a modulelist/sequential with a non-integer literal Pull Request resolved: #43361 Reviewed By: mrshenli Differential Revision: D23602388 Pulled By: eellison fbshipit-source-id: 51fa28d5bc45720529b3d45e92d367ee6c9e3316
No description provided.