From 2003de924bd53596f09851bf6f55f5068fffe985 Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Mon, 20 Jun 2022 19:37:34 +0200 Subject: [PATCH] Fixed a lack of repr causing bugs on inspect --- src/bootstraparse/modules/environment.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bootstraparse/modules/environment.py b/src/bootstraparse/modules/environment.py index 305113c..1a1944e 100644 --- a/src/bootstraparse/modules/environment.py +++ b/src/bootstraparse/modules/environment.py @@ -104,3 +104,12 @@ class Environment: f'\nSecondary parameters:\n{self._sParams}' f'\nReserved parameters are preceded with an underscore.' ), level='CRITICAL') # Could also add attribute as a new entry + + def __repr__(self): + """ + Returns a string representation of the environment. + :return: String representation of the environment. + """ + return f'Environment object with the following parameters:\n' \ + f'Mandatory parameters:\n{self._mParams}\n' \ + f'Secondary parameters:\n{self._sParams}' \ No newline at end of file