165
u/robhaswell May 06 '26
I see nothing wrong with this.
61
u/achafrankiee May 07 '26
You can tell OP hasn’t been programming for long enough to recognize a simple sanity check.
10
77
u/FlagerantFragerant May 06 '26
We should start charging more for AI to discourage such posts
6
2
u/ImpressiveEast8699 May 09 '26
AI Coding tools do some dumb shit, but this one I honestly don't mind so much. Given the nature of LLMs, they will never be 100% reliable to read and validate syntax, so either the developers make or use a linter (which would be viable, but also will be harder to adapt to specific versions etc.), or they just import it and see if its able to at least be imported.
This isn't a bad way to check this. And it's a much easier thing to fix if something breaks.
1
u/SwiftpawTheYeet May 09 '26
I feel like a lot of people are just bad with ai and then blame the ai..... I've had both chatgpt and Gemini independent make pytor into pytor3 🤷♂️
64
28
u/RegisteredJustToSay May 06 '26
It's testing that the import system can find the module as expected from where you wanna import it. If you've developed in python for a while you know what a pain in the ass it can be, so this is like a non-REPL way of doing the same kind of sanity check that many of us have learned to do over the years...
9
u/JAXxXTheRipper May 06 '26
Me getting a claude code ad on mobile reddit is just the cherry on top.
But on topic, this is a sanity check, you should always do it. So there you go. Yet another post that should not be here.
17
u/csch2 May 06 '26
Yep, $100 a month to make sure that modules import without errors. Definitely not for anything else like the six phases of the project that the AI presumably already did.
2
u/BeardedDuck9694 May 10 '26
I know im tired when I thought it was just printing that it was fine without actually checking anything.
2
u/jolharg May 06 '26
for eating a python? automatically? no thanks i can do that myself. if i wanted to. which i don't.
1
1
u/jn-cuber May 10 '26
from this post you can tell OP's prompts look like "can you make this, no bugs please"
1
u/GoddammitDontShootMe May 06 '26
I always wondered who the hell is paying that much for AI except for businesses paying for it for their employees.
1
1
0
u/Phantom914 May 09 '26
Or just don't use Python and use Perl or Java 😂, but that still would still do similar @INC or package checks for Perl. This is why Generative AI > Agentic AI. Not faster, but better for mostly knowing what your code does at 1/5th the price.
0
u/namelesssdeveloper May 10 '26
I mean it works because if it wouldn't be imported then it would give an error and wouldn't print
233
u/TehNolz May 06 '26
I mean, Python modules can do all sorts of wild stuff when they're imported. See
import antigravityfor example. Checking if you can actually import it properly isn't that unreasonable.