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

STL map bind naming fix for Sphinx and Pylance #3985

Closed
wants to merge 1 commit into from

Conversation

themarpe
Copy link

@themarpe themarpe commented Jun 2, 2022

Description

Addresses a change in: #3310
Discussion/rationale can be found over at: #3310 (comment)

Suggested changelog entry:

Fixes the class names generated by ``bind_map``:
- Change the naming from ``*View[name]`` to ``*View_name``

@Skylion007
Copy link
Collaborator

Okay, so this probably isn't the right the fix. This is caused by a bug where the typing name should be KeyView[class_name] , not class_name.KeyView[class_name]. If we fix this, MyPy etc... should be happy with it. This just makes the KeyView, ViewName etc function as it's own class, when really it should just be a specializing of the typing.KeyView, ItemView etc...

@themarpe
Copy link
Author

themarpe commented Jun 2, 2022

Thanks @Skylion007
Let me know how you'd go about doing this change - feel free to request changes here or if separate PR is needed

@Skylion007
Copy link
Collaborator

Okay, so I tried something and it didn't quite work unfortunately. We need some way to get mypy to pickup on that fact that class_name.KeyView[class_name] is an alias / subclass of typing.KeyView, but I am not sure what the best way to do that is. We would need a reproducer of the mypy complaints and see if there isn't away we can fix it with an alias, subclass, typing mixin, etc...

@rwgk @henryiii I am stumped any idea how to proceed? I am going to open an issue to track this.

@themarpe
Copy link
Author

themarpe commented Jun 2, 2022

Thanks for the information layed out in the issue - this was beyond my understanding of the issue at hand.
Looking forward on the debate evolving there

@themarpe
Copy link
Author

themarpe commented Jun 7, 2023

Seems to be superseded by: #4353

@themarpe themarpe closed this Jun 7, 2023
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