From e4544a93277f661636cde1a0b9475dc9039c419a Mon Sep 17 00:00:00 2001 From: Corvince <13568919+Corvince@users.noreply.github.com> Date: Fri, 5 Feb 2021 12:43:16 +0100 Subject: [PATCH] remove type comments --- mesa/space.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mesa/space.py b/mesa/space.py index 5ea2bfcd152..e3b389ccada 100644 --- a/mesa/space.py +++ b/mesa/space.py @@ -101,7 +101,7 @@ def __init__(self, width: int, height: int, torus: bool) -> None: self.empties = set(itertools.product(*(range(self.width), range(self.height)))) # Neighborhood Cache - self._neighborhood_cache = dict() # type: Dict[Any, List[Coordinate]] + self._neighborhood_cache: Dict[Any, List[Coordinate]] = dict() @staticmethod def default_val() -> None: @@ -197,7 +197,7 @@ def get_neighborhood( neighborhood = self._neighborhood_cache.get(cache_key, None) if neighborhood is None: - coordinates = set() # type: Set[Coordinate] + coordinates: Set[Coordinate] = set() x, y = pos for dy in range(-radius, radius + 1): @@ -247,7 +247,6 @@ def iter_neighbors( An iterator of non-None objects in the given neighborhood; at most 9 if Moore, 5 if Von-Neumann (8 and 4 if not including the center). -g """ neighborhood = self.get_neighborhood(pos, moore, include_center, radius) return self.iter_cell_list_contents(neighborhood)