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

Use most recent Python Syntax in .pyi files #161

Open
2 of 8 tasks
JonathanPlasse opened this issue Dec 17, 2023 · 6 comments
Open
2 of 8 tasks

Use most recent Python Syntax in .pyi files #161

JonathanPlasse opened this issue Dec 17, 2023 · 6 comments
Assignees

Comments

@JonathanPlasse
Copy link
Sponsor Contributor

JonathanPlasse commented Dec 17, 2023

In .pyi files, the most recent syntax of python can be used, as it is only used for static analysis.

Therefore, these changes can be made:

I could work on this, to familiarize myself with the codebase.

@nutti
Copy link
Owner

nutti commented May 12, 2024

@JonathanPlasse

Yes, go ahead.
Currently, we use Python 3.9 for the generation which does not support these syntax.
You many need to change Python version as well.

@JonathanPlasse
Copy link
Sponsor Contributor Author

Ok, I will start working on it.

@nutti
Copy link
Owner

nutti commented May 16, 2024

@JonathanPlasse

#207 is merged now.
Will you also tackle the remain (PEP695) as wall?

@JonathanPlasse
Copy link
Sponsor Contributor Author

I will.

@Road-hog123
Copy link
Contributor

Can I suggest PEP 673's Self type as a related change?

Presently ID.evaluated_get() returns ID, but if this were changed to Self then I believe Object.evaluated_get() would correctly return Object instead of ID.

Unfortunately the documentation just lists the return type as ID, so I don't know if there's anything for the generation code to detect to make this change automatically.

@JonathanPlasse
Copy link
Sponsor Contributor Author

To avoid regression, we should use the plugin flake-pyi available in Ruff to check we use the modern syntax in the generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants