From a6ce6259faebf039c95191c1fcb9c20e8ed1b2fc Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 4 Sep 2017 14:56:27 +0200 Subject: [PATCH 1/3] Mark TabError as noqa to silence linters on Python 3 --- mixed_tabs_and_spaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixed_tabs_and_spaces.py b/mixed_tabs_and_spaces.py index 23a5329..208f2b5 100755 --- a/mixed_tabs_and_spaces.py +++ b/mixed_tabs_and_spaces.py @@ -2,6 +2,6 @@ def square(x): sum_so_far = 0 for counter in range(x): sum_so_far = sum_so_far + x - return sum_so_far + return sum_so_far # noqa Python 3 will raise a TabError here print(square(10)) From c0a81511532c22ec0bf18b7f5b9670b6e5d11f4e Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 4 Sep 2017 18:42:42 +0200 Subject: [PATCH 2/3] # noqa: E999 # pylint: disable=bad-indentation --- mixed_tabs_and_spaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixed_tabs_and_spaces.py b/mixed_tabs_and_spaces.py index 208f2b5..1778b5c 100755 --- a/mixed_tabs_and_spaces.py +++ b/mixed_tabs_and_spaces.py @@ -2,6 +2,6 @@ def square(x): sum_so_far = 0 for counter in range(x): sum_so_far = sum_so_far + x - return sum_so_far # noqa Python 3 will raise a TabError here + return sum_so_far # noqa: E999 # pylint: disable=bad-indentation Python 3 will raise a TabError here print(square(10)) From 68c675bb8e81ea7757409543780a8580f140df44 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 4 Sep 2017 19:19:16 +0200 Subject: [PATCH 3/3] # noqa: E999 # pylint: disable=mixed-indentation --- mixed_tabs_and_spaces.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mixed_tabs_and_spaces.py b/mixed_tabs_and_spaces.py index 1778b5c..ec6cf40 100755 --- a/mixed_tabs_and_spaces.py +++ b/mixed_tabs_and_spaces.py @@ -1,7 +1,7 @@ def square(x): sum_so_far = 0 - for counter in range(x): - sum_so_far = sum_so_far + x - return sum_so_far # noqa: E999 # pylint: disable=bad-indentation Python 3 will raise a TabError here + for _ in range(x): + sum_so_far += x + return sum_so_far # noqa: E999 # pylint: disable=mixed-indentation Python 3 will raise a TabError here print(square(10))