@staticmethod
PYL-R0201505 s += "{0}],\n{0}path={1!r}\n)".format(self.indent, node.path)
506 return s
507
508 def visit_message(self, node):509 return "Message({0!r})".format(node.message)
510
511 def visit_question(self, node):
543 s += "\n)"
544 return s
545
546 def visit_statefile(self, node):547 s = "{0}(default_file={1!r}, check={2}, ask_filename={3})"
548 s = s.format(
549 node.__class__.__name__, node.default_file, node.check, node.ask_filename
722 def visit_pass(self, node):
723 pass
724
725 def visit_message(self, node):726 print_color(node.message)
727
728 def visit_question(self, node):
68 new_hist.flush(at_exit=True)
69 return new_hist
70
71 def _merge_envs(self, merge_envs, re_env): 72 new_env = {}
73 for e in merge_envs:
74 if e == "replay":
57 def runtest(self, *args, **kwargs):
58 self._test_func(*args, **kwargs)
59
60 def repr_failure(self, excinfo):61 """ called when self.runtest() raises an exception. """
62 formatted_tb = _limited_traceback(excinfo)
63 formatted_tb.insert(0, "xonsh execution failed\n")
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.