Ad
  • Custom User Avatar

    Why in this test exception should not be raised?

    return_types = (<class 'dict'>,) 
    return_something's output = Counter({'e': 2, 'r': 1})  # type(output) = <class 'collections.Counter'>
    

    Counter class is a dict subclass, not dict in itself.

    The same in random tests:

    return_types = (<class 'tuple'>, <class 'collections.abc.Iterable'>, <class 'set'>, <class 'str'>, <class 'function'>, <class 'dict'>, <class 'collections.deque'>, <class 'int'>)
    return_something's output = Counter({'d': 2, 'r': 1, 't': 1, 's': 1, 'g': 1})  # type(output) = <class 'collections.Counter'>
    

    According to tests, exception also should not be raised.

    Why?

  • Custom User Avatar

    'LSB(least significant bit) convention is used, all hashes must be converted from MSB to LSB'

    Could you explain what does this sentence means ? How should I understand it ?

    So hashes, which are passed to function are in MSB convention? And they should be converted to LSB before concatenation?