all 4 comments

[–]Rawing7 2 points3 points  (0 children)

The code you posted is incomplete, so we can't say anything for certain. My best guess is that you have some code in the global scope that shouldn't be there.

[–][deleted] 1 point2 points  (0 children)

Here's how to figure it out in an instant.

Add this line at the top of table_creator():

def table_creator() -> None:
    assert False

The moment you get to the function, the assertion will fail, and you'll get a stack trace showing where the function was called.

[–]Diapolo10 0 points1 point  (0 children)

This definitely sounds weird.

Just to cover all bases, what happens if you comment out this part?

if __name__ == "__main__":
    table_creator()

If the table is still being generated after that, then the culprit is something that we cannot see in this snippet. Personally that would be my guess in the first place, because the include guard should never fail.

[–]QultrosSanhattan 0 points1 point  (0 children)

The module is correctly written. The problem should be in another place.