def test_memoize(self):
        def fib(n):
            return n if 2 < n else fib(n - 1) + fib(n - 2)

        fastFib = _.memoize(fib)
        self.assertEqual(
            fib(10), 55, 'a memoized version of fibonacci'
                         ' produces identical results')
        self.assertEqual(
            fastFib(10), 55, 'a memoized version of fibonacci'
            ' produces identical results')
        self.assertEqual(
            fastFib(10), 55, 'a memoized version of fibonacci'
            ' produces identical results')
        self.assertEqual(
            fastFib(10), 55, 'a memoized version of fibonacci'
            ' produces identical results')

        def o(str):
            return str

        fastO = _.memoize(o)
        self.assertEqual(o('upper'), 'upper', 'checks hasOwnProperty')
        self.assertEqual(fastO('upper'), 'upper', 'checks hasOwnProperty')
dataset/ETHPy150Open serkanyersen/underscore.py/tests/test_functions.py/TestStructure.test_memoize/swapped operands of `<`