/usr/lib/python3/dist-packages/postgresql/types/io/pg_bitwise.py is in python3-postgresql 1.1.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from .. import BITOID, VARBITOID
from ..bitwise import Varbit, Bit
from . import lib
def varbit_pack(x, pack = lib.varbit_pack):
return pack((x.bits, x.data))
def varbit_unpack(x, unpack = lib.varbit_unpack):
return Varbit.from_bits(*unpack(x))
oid_to_io = {
BITOID : (varbit_pack, varbit_unpack, Bit),
VARBITOID : (varbit_pack, varbit_unpack, Varbit),
}
oid_to_type = {
BITOID : Bit,
VARBITOID : Varbit,
}
|