Skip to content

Commit

Permalink
Suppress mypy error on a common theme
Browse files Browse the repository at this point in the history
It's about "variable reuse with different types".
Here's one of the issues:
python/mypy#1174
  • Loading branch information
Lai-YT committed Jan 14, 2022
1 parent 76f97b6 commit 7abd55d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion concentration/grader.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ def _grade_intervals(self) -> None:
# Second, grade the REAL_TIME and LOW_FACEs.
# Additionally grade EXTRUSIONs if existed.
while self._curr_heap:
interval, type, blink_rate = self._curr_heap.pop()
interval, type, blink_rate = self._curr_heap.pop() # type: ignore
# Error because of the following reason:
# Variable reuse within one function body. Mypy really prefers that you don't do that.
# I decide to ignore and keep clean.
if not self._is_graded_interval(interval):
if type is IntervalType.LOW_FACE:
recorded = self._perform_low_face_grading(interval)
Expand Down

0 comments on commit 7abd55d

Please sign in to comment.