summaryrefslogtreecommitdiff
path: root/jq.pyx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-04-18 18:51:16 +0100
committerMichael Williamson <mike@zwobble.org>2020-04-18 18:51:16 +0100
commit79c418d19c985e6c1882556f48c80a236ff56d8d (patch)
tree8264d7ec9dbf2e4922e73f8d0e955fd4cf57e600 /jq.pyx
parent764c8333faf3c630cbff5e562bf8c22a1676265e (diff)
Allow retrieval of original program string
Diffstat (limited to 'jq.pyx')
-rw-r--r--jq.pyx6
1 files changed, 5 insertions, 1 deletions
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):