Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

            def _u(s, encoding='unicode_escape'):
        return unicode(s, encoding)
        


src/b/t/BTrees-4.0.8/BTrees/tests/testBTreesUnicode.py   BTrees(Download)
    def setUp(self):
        #setup an OOBTree with some unicode strings
        from BTrees.OOBTree import OOBTree
        from BTrees._compat import _bytes
        from BTrees._compat import _u
 
        self.s = _u(b'dreit\xe4gigen', 'latin1')
                     (b'quick', 5),
                     (b'zerst\xf6rt', 6),
                     (_u(b'dreit\xe4gigen','latin1'), 7),
                    ]
 
        self.tree = OOBTree()
        for k, v in self.data:
            if isinstance(k, _bytes):
                k = _u(k, 'latin1')
    def testAllKeys(self):
        # check every item of the tree
        from BTrees._compat import _u
        from BTrees._compat import _bytes
        for k, v in self.data: