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

Implement return type inference for methods of builtin types #5865

Merged
merged 9 commits into from Nov 25, 2023

Conversation

scoder
Copy link
Contributor

@scoder scoder commented Nov 24, 2023

No description provided.

@scoder scoder added this to the 3.1 milestone Nov 24, 2023
Comment on lines +572 to +573
if 'T' in return_type_name:
return_type_name = return_type_name.replace('T', builtin_type.name)
Copy link
Contributor

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 is used, given you drop everything in front of the [ earlier. It also feels a little fragile to me (although I can't see anywhere above where it should fail)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the "drop the '[' part" is actually meant as a temporary work-around for our lack of generics. It should get removed at some point. I had considered to add a comment and I should have.

@scoder scoder merged commit 4847429 into cython:master Nov 25, 2023
63 checks passed
@scoder scoder deleted the builtin_method_types branch November 25, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants