Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is just trying to be
isidentifier()- so maybe also kill the wholevalid_identifier_charsthing?Uh oh!
There was an error while loading. Please reload this page.
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.
isidentifier()doesn't allow names that are partially valid. I don't know how likely such names are.https://learn.microsoft.com/en-us/windows/win32/api/oaidl/nf-oaidl-idispatch-gettypeinfo#parameters explicitly mentions that "localized member names" are allowed -- but doesn't list any constraints.
Since IDispatch only ever deals with member names as strings, it seems that theoretically, any string whatsoever is valid.
If that is the case, an ideal solution would be to filter out any characters that are invalid according to Python identifier rules -- but CPython doesn't provide any facilities to check if a character has
XID_StartorXID_ContinueUnicode property other than viaisidentifier(). So the proposed change is a stopgap solution.There are 3rd-party modules that can check Unicode properties, e.g. https://pypi.org/project/regex/ , if that's an option.