mesa icon indicating copy to clipboard operation
mesa copied to clipboard

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

Open rht opened this issue 2 years ago • 6 comments

Looks like it is possible to do it even on Python older than 3.10. See https://github.com/projectmesa/mesa-geo/pull/67#discussion_r881122416=.

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.

rht avatar May 25 '22 03:05 rht

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

EwoutH avatar Jul 03 '22 21:07 EwoutH

Hey @EwoutH, Is this still open?

ayeankit avatar Feb 26 '23 17:02 ayeankit

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.

Aryan1Mahahjan avatar Jan 22 '24 10:01 Aryan1Mahahjan

Still not applicable, because the oldest supported Python is still 3.9: https://github.com/projectmesa/mesa/blob/665aebc3ac365ff18847a6032e604a35eeee7297/pyproject.toml#L9.

rht avatar Jan 22 '24 11:01 rht

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.

EwoutH avatar Jan 22 '24 12:01 EwoutH

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]

manvendra5345 avatar Mar 08 '24 07:03 manvendra5345