• 0 Posts
  • 191 Comments
Joined 2 years ago
cake
Cake day: July 1st, 2023

help-circle
  • How is that checker configured?

    It might be doing something like this:

    import student_module
    student_module.main()
    

    and because you’re already invoking main as the module is imported, it’s getting stuck the second time around. Maybe add some indicative print at the entrypoint to your main function.

    Another reply in here has supplied the standard idiom for making a module executable:

    if __name__ == "__main__":
      main()
    















  • “Since we are talking about aggregating documents into an index, the word semigroup might pop into our heads.”

    This is why Haskell tutorials have a bad rep. Why not use a common English term like “monoid” instead?

    Snark aside, the <> approach to solving the problem piecewise and aggregating the results into a larger instance of the same type is a really convenient approach.