Comments
Hacker News
by kelsolaar
#pragma is a real keyword in C but # is just a comment in python - why not use a pythonic @decorator?
Vendoring a library like this into an app seems like a lot more toil than just writing the native multiprocessing python code, or using something built for number crunching like arrayfire or numpy
That's a problem for me, given what this library does: arbitrary transformations of Python code at load time. The fragility, security risk, and complexity added by basically writing a subdialect of Python with new semantics is something I'd like to see more human attention on and maturity of before I consider using it. There are times when AI smell doesn't concern me much when deciding whether or not to use someone's code. This isn't one of those times.
by zbentley
for i in range(len(records)):
scores[i] = score(records[i])
Better for i, record in enumerate(records):
scores[i] = score(record)
Best scores = [score(record) for record in records]
Raymond Hettinger (Python core dev): https://gist.github.com/bespokoid/205efd91546ddb16b210678830...by gabrielsroka
Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- This should be part of the Standard Library if so efficient.by kelsolaar
- Interesting to see the rust code is doing the actual parallelization, while execution. Will it work for complex loops, and what happens if the loops uses global context and different variables, outside of the loop?. May be it should go to python standard library.
- I think I’m a little skeptical.
#pragma is a real keyword in C but # is just a comment in python - why not use a pythonic @decorator?
Vendoring a library like this into an app seems like a lot more toil than just writing the native multiprocessing python code, or using something built for number crunching like arrayfire or numpy
- This code seems to be fairly pervasively AI-written (both structurally/syntacticly, with many additional AI verbosity tells in the documentation, and going by the commit history).
That's a problem for me, given what this library does: arbitrary transformations of Python code at load time. The fragility, security risk, and complexity added by basically writing a subdialect of Python with new semantics is something I'd like to see more human attention on and maturity of before I consider using it. There are times when AI smell doesn't concern me much when deciding whether or not to use someone's code. This isn't one of those times.
by zbentley - Not very Pythonic
Betterfor i in range(len(records)): scores[i] = score(records[i])
Bestfor i, record in enumerate(records): scores[i] = score(record)
Raymond Hettinger (Python core dev): https://gist.github.com/bespokoid/205efd91546ddb16b210678830...scores = [score(record) for record in records]by gabrielsroka