News for hackers. Stuff that matters.
Re:As an experienced LLM user, I don't use generative LLMs o... by Scarblac on Monday May 05, 2025 @03:11PM (#43898382)
When a module is first loaded, it's compiled to bytecode and then executed. Importing a non existing function will throw an error right away.

It's not a compilation error but it does feel like one, somewhat. It happens at more or less the same time.

Re:As an experienced LLM user, I don't use generative LLMs o... by graemep on Tuesday May 06, 2025 @05:39AM (#43903218)
Yes, that works if you do:

    from foo import nonexistent
but if you do:

    import foo

    foo.nonexistent()
You get a run time error.

A lot of the time with Python you will be importing classes so it will be mostly run time errors.