Skip to content

Commit 7eca76f

Browse files
authored
[2018] Remove Python 2.7 support (#58)
* [2018] Remove Python 2.7 support * Fix readme
1 parent b0b290f commit 7eca76f

File tree

26 files changed

+12
-67
lines changed

26 files changed

+12
-67
lines changed

2018/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://adventofcode.com/2018
55
## Language
66

77
This year I chose to implement in Python 2, but ported the code such that it
8-
works in either Python 2 or Python 3.
8+
works properly in Python 3. Python 2 support has been removed.
99

1010
## Preparation
1111

2018/day01/day01.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/1
55
"""
66

7-
from __future__ import print_function
8-
97
from functools import reduce
108

119

2018/day02/day02.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/2
55
"""
66

7-
from __future__ import print_function
8-
97
from collections import Counter, defaultdict
108
from functools import reduce
119

2018/day03/day03.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/3
55
"""
66

7-
from __future__ import print_function
8-
97
import re
108
from collections import defaultdict
119
from functools import reduce

2018/day04/day04.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/4
55
"""
66

7-
from __future__ import print_function
8-
97
import re
108
from collections import defaultdict
119

2018/day05/day05.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/5
55
"""
66

7-
from __future__ import print_function
8-
97
from string import ascii_lowercase
108

119

2018/day06/day06.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
https://adventofcode.com/2018/day/6
55
"""
66

7-
from __future__ import print_function
8-
97
import sys
108
from functools import reduce
119

12-
_MIN_INT = -sys.maxsize - 1
13-
1410

1511
class Point:
1612
"""Represents a point in 2D space."""
@@ -37,10 +33,10 @@ class Rect:
3733
@staticmethod
3834
def bounding_box(points):
3935
"""Returns a rectangle which forms the boundary of all points"""
40-
min_x = sys.maxsize
41-
min_y = sys.maxsize
42-
max_x = _MIN_INT
43-
max_y = _MIN_INT
36+
min_x = float('inf')
37+
min_y = float('inf')
38+
max_x = float('-inf')
39+
max_y = float('-inf')
4440

4541
for point in points:
4642
min_x = min(min_x, point.coord_x)

2018/day07/day07.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/7
55
"""
66

7-
from __future__ import print_function
8-
97
import re
108
from collections import defaultdict
119

2018/day08/day08.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/8
55
"""
66

7-
from __future__ import print_function
8-
97

108
class TreeNode: # pylint: disable=too-few-public-methods
119
"""Represents a single node in the tree."""

2018/day09/day09.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
https://adventofcode.com/2018/day/9
55
"""
66

7-
from __future__ import print_function
8-
97
import re
108
from collections import defaultdict
119

0 commit comments

Comments
 (0)