From b9f9df7e0654afc0a1c577825fdd0040cfbe94ff Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Mon, 13 Jan 2020 11:19:35 +1100 Subject: [PATCH] Add __str__ method for Result --- CHANGELOG.rst | 5 +++++ src/minizinc/result.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fd33583..5300018 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,11 @@ Added - Add initial ``Checker`` class to allow the usage of MiniZinc solution checkers. +Changed +^^^^^^^ +- The string method for ``Result`` will now refer to the string method of its + ``Solution`` attribute. + Fixed ^^^^^ - Ensure the event loop selection on Windows to always selects diff --git a/src/minizinc/result.py b/src/minizinc/result.py index d571620..a1b29aa 100644 --- a/src/minizinc/result.py +++ b/src/minizinc/result.py @@ -283,6 +283,9 @@ def __len__(self): else: return 1 + def __str__(self): + return str(self.solution) + def parse_solution( raw: bytes, output_type: Type, enum_map: Dict[str, Enum]