From 79c418d19c985e6c1882556f48c80a236ff56d8d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 18 Apr 2020 18:51:16 +0100 Subject: Allow retrieval of original program string --- jq.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jq.pyx') diff --git a/jq.pyx b/jq.pyx index 6d26470..cad78e5 100644 --- a/jq.pyx +++ b/jq.pyx @@ -131,8 +131,12 @@ cdef class _Program(object): program_with_input._bytes_input = string_input.encode("utf8") return program_with_input + @property + def program_string(self): + return self._program_bytes.decode("utf8") + def __repr__(self): - return "jq.compile({!r})".format(self._program_bytes.decode("utf8")) + return "jq.compile({!r})".format(self.program_string) cdef class _ProgramWithInput(object): -- cgit v1.2.3