summaryrefslogtreecommitdiff
path: root/coverage/numbits.py
diff options
context:
space:
mode:
authorSimon Willison <swillison@gmail.com>2019-11-12 08:15:24 -0800
committerNed Batchelder <ned@nedbatchelder.com>2019-11-12 21:06:57 -0500
commitb5c69bd598d31173695453cedb18211e292ec777 (patch)
treed2d5ea41ec7dd48e03b2586af62a7b6272b5efb4 /coverage/numbits.py
parent09adf5d4b238cc1443b4ae7fcdfe34997cfcf00a (diff)
downloadpython-coveragepy-git-b5c69bd598d31173695453cedb18211e292ec777.tar.gz
Expose numbits_to_nums() SQL function, refs #868
Diffstat (limited to 'coverage/numbits.py')
-rw-r--r--coverage/numbits.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/coverage/numbits.py b/coverage/numbits.py
index 367ec6a1..c4f0ad02 100644
--- a/coverage/numbits.py
+++ b/coverage/numbits.py
@@ -13,6 +13,7 @@ in the blobs should be considered an implementation detail that might change in
the future. Use these functions to work with those binary blobs of data.
"""
+import json
from coverage import env
from coverage.backward import byte_to_int, bytes_to_ints, binary_bytes, zip_longest
@@ -154,3 +155,4 @@ def register_sqlite_functions(connection):
connection.create_function("numbits_intersection", 2, numbits_intersection)
connection.create_function("numbits_any_intersection", 2, numbits_any_intersection)
connection.create_function("num_in_numbits", 2, num_in_numbits)
+ connection.create_function("numbits_to_nums", 1, lambda b: json.dumps(numbits_to_nums(b)))