def test_leng(self):
        '''Test asizeof.leng()
        '''
        l = [1,2,3,4]
        s = "spam"
        self.assert_(asizeof.leng(l) >= len(l), asizeof.leng(l))
        self.assertEqual(asizeof.leng(tuple(l)), len(l))
        self.assert_(asizeof.leng(set(l)) >= len(set(l)))
        self.assert_(asizeof.leng(s) >= len(s))

        # Python 3.0 ints behave like Python 2.x longs. leng() reports
        # None for old ints and >=1 for new ints/longs.
        self.assert_([None, 1] in asizeof.leng(42), asizeof.leng(42))
        base = 2
        try:
            base = long(base)
        except NameError: # Python3.0
            pass
        self.assertEqual(asizeof.leng(base**8-1), 1)
        self.assertEqual(asizeof.leng(base**16-1), 1)
        self.assert_(asizeof.leng(base**32-1) >= 1)
        self.assert_(asizeof.leng(base**64-1) >= 2)
dataset/ETHPy150Open pympler/pympler/test/asizeof/test_asizeof.py/FunctionTest.test_leng/swapped operands of `in`