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

type annotations: Replace Union[a, b] with a | b, Optional[a] with a | None #1341

Open
rht opened this issue May 25, 2022 · 6 comments
Open

Comments

@rht
Copy link
Contributor

rht commented May 25, 2022

Looks like it is possible to do it even on Python older than 3.10. See projectmesa/mesa-geo#67 (comment).

Update: from implementing #1345, looks like older Pythons don't support type aliases with | yet. For this issue to be completely resolved, we need to wait until 3.10 is the oldest supported version.

@EwoutH
Copy link
Member

EwoutH commented Jul 3, 2022

pyupgrade should be able to do that automatically (by running pyupgrade --py310-plus).

@ayeankit
Copy link

Hey @EwoutH, Is this still open?

@Aryan1Mahahjan
Copy link

I noticed this issue hasn't been updated in a while. Is it still relevant and open for contributions? Specifically, I'm interested in working on #1341.

@rht
Copy link
Contributor Author

rht commented Jan 22, 2024

Still not applicable, because the oldest supported Python is still 3.9:

requires-python = ">=3.9"
.

@EwoutH
Copy link
Member

EwoutH commented Jan 22, 2024

According to SPEC 0 we could drop Python 3.9 support already. But since Python 3.9 is still quite well supported (also by NumPy for example), I would propose keeping it for a bit until Mesa 2.3 is released. Then for 2.4 or 3.0 we can drop 3.9 and require 3.10+.

@Aryan1Mahahjan you could already make an PR, make sure it's passing on the current CI for Python 3.10 and higher. But you might need to update the PR in a few months.

Note that pyupgrade can probably already do a part of the work.

@manvendra5345
Copy link

Hi everyone!
I am Manvendra Singh Solanki from Cse Ai-Ml background and i am also interested in working in this project , I know python , java , HTML , CSS . I can adapt very fast and have great learning capacity but these thing are common what i think i have different in me is that i want to learn from thoes who are better than me and catch up to them and even beat them and always keep learning.

I also want to contribute and learn but i am new to this platform please guide me .

Email:- [email protected]

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

5 participants