coralnet / pyspacer

Python based tools for spatial image analysis
MIT License
6 stars 2 forks source link

Use newer type hint syntax #72

Closed StephenChan closed 7 months ago

StephenChan commented 7 months ago

Mostly PEP 585 and PEP 604. I keep wanting to do this every time I edit a file, so might as well get it all out of the way before working on other stuff.

Replacing Optional[x] with x | None is a little picky, but all else being equal, I think it's better to have one less import. (The from __future__ import annotations imports should no longer be necessary whenever pyspacer's minimum version is bumped far enough; I believe it's 3.9 for PEP 585, 3.10 for PEP 604.)