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

typing #59

Closed
wants to merge 2 commits into from
Closed

typing #59

wants to merge 2 commits into from

Conversation

JaskRendix
Copy link
Contributor

@JaskRendix JaskRendix commented Jan 11, 2024

PR:

  • bumps python to 3.9 and sets tests for 3.10/11/12
  • uses black (default -l88);
  • removes all the imports from typing (eg from typing import List -> simply list, from typing import Sequence > from collections.abc import Sequence, etc.);
  • typehints 382 > 240

and updates:

    tile_size = None             # (int, int): size of each tile in pixels
    map_size = None              # (int, int): size of map in tiles
    visible_tile_layers = None   # list of visible layer integers

into

    # (int, int): size of each tile in pixels
    tile_size: Vector2DInt = (0,0) (or tuple[int, int])
    # (int, int): size of map in tiles
    map_size: Vector2DInt = (0,0) (or tuple[int, int])
    # list of visible layer integers
    visible_tile_layers: list[int] = [] (or Iterable[int] or Iterable[Any]?)

the alternative is to disseminate multiple asserts around the code

        self._tile_view = None        # this rect represents each tile on the buffer

        self._tile_view = Rect(
            0, 0, 0, 0
        )  # this rect represents each tile on the buffer

same as above (asserts)

@JaskRendix JaskRendix force-pushed the typing branch 6 times, most recently from 883040e to fda29d5 Compare January 14, 2024 07:47
@JaskRendix JaskRendix marked this pull request as draft January 14, 2024 09:06
@JaskRendix JaskRendix marked this pull request as ready for review January 16, 2024 13:44
@JaskRendix JaskRendix marked this pull request as draft January 17, 2024 11:48
@JaskRendix JaskRendix closed this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant