Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

with that expected use case of uv script run command it effectively makes those comments executable

python's wheels are falling off at an ever faster and faster rate



Because of a feature that solves the problem of one off scripts being difficult the moment you need a 3rd party library?

A more Pythonic way of doing this might be __pyproject__ bit that has the tiiiiny snag of needing to execute the file to figure out its deps. I would have loved if __name__ == "pyproject" but while neat and tidy it is admittedly super confusing for beginners, has a "react hooks" style gotcha where to can't use any deps in that block, and you can't use top level imports. The comment was really the easiest way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: