From 22f218c054e9811360a6056ba1510d8ec10e8d86 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 24 Oct 2021 19:06:27 -0700 Subject: [PATCH] Grid.save() should return self --- gridlock/grid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gridlock/grid.py b/gridlock/grid.py index 9792858..0a77ba1 100644 --- a/gridlock/grid.py +++ b/gridlock/grid.py @@ -314,15 +314,19 @@ class Grid: g.__dict__.update(tmp_dict) return g - def save(self, filename: str): + def save(self: T, filename: str) -> T: """ Save to file. Args: filename: Filename to save to. + + Returns: + self """ with open(filename, 'wb') as f: pickle.dump(self.__dict__, f, protocol=2) + return self def copy(self: T) -> T: """