return bf with the given values in dec [n1, n2, n3...] packed
(self,pack)
| 64 | return r |
| 65 | |
| 66 | def pack(self,pack): |
| 67 | "return bf with the given values in dec [n1, n2, n3...] packed" |
| 68 | r=bf(); ss=0;pack.reverse() |
| 69 | for i in pack: |
| 70 | l1=len(bin(i))-2 |
| 71 | r.__setslice__(ss,ss+l1,i) |
| 72 | ss +=l1 |
| 73 | return r |
| 74 | |
| 75 | |
| 76 | if __name__ == "__main__": |
no test coverage detected