Skip to content

test_perfect_hashing fails #19

@wojtask

Description

@wojtask
Error
Traceback (most recent call last):
  File "\\wsl$\Ubuntu\home\kwojtas\cormenpy\test\test_chapter11\test_textbook11_5.py", line 16, in test_perfect_hashing
    table, h = perfect_hashing_init(keys)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\\wsl$\Ubuntu\home\kwojtas\cormenpy\src\chapter11\textbook11_5.py", line 12, in perfect_hashing_init
    p = random.choice(list(sieve.primerange(max_key + 1, 2 * max_key + 1)))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kwojtas\AppData\Local\Programs\Python\Python311\Lib\random.py", line 370, in choice
    raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions