From d0d995b3a4f9f6e41bf60ed0e8b02172cc714eee Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Fri, 5 Mar 2021 11:05:57 -0800 Subject: [PATCH] Use the more convenient _asdict() function of named tuples. --- BaseClasses.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 76714117..64453fd8 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1509,11 +1509,7 @@ class PlandoItem(NamedTuple): self.warn(warning) def to_dict(self): - return {"item": self.item, - "location": self.location, - "world": self.world, - "from_pool": self.from_pool, - "force": self.force} + return self._asdict() class PlandoConnection(NamedTuple): @@ -1522,6 +1518,4 @@ class PlandoConnection(NamedTuple): direction: str # entrance, exit or both def to_dict(self): - return {"entrance": self.entrance, - "exit": self.exit, - "direction": self.direction} + return self._asdict()