6 ms·
I don't understand how things like this get approved into PEPs.
by aeurielesn 2y ago
I don't understand how things like this get approved into PEPs.
- deleted 2y ago[deleted]
- zanie 2y agoAs in, you think this shouldn't be possible or you think it should be written differently?
- Karupan 2y agoSeems like a great way to write self documenting code which can be optionally used by your python runtime.
- linsomniac 2y agoI don't think this IS a PEP, I believe it is simply something the uv tool supports and as far as Python is concerned it is just a comment.
- zanie 2y agoNo, this is a language standard now (see PEP 723)
- mkl 2y agohttps://peps.python.org/pep-0723/ https://peps.python.org/pep-0723/
- linsomniac 2y agoThank you for the pointer, I had searched for it but couldn't find it. (edit: Glad I spent the downvotes to get educated :-)
- epistasis 2y agoThe PEP page is really good at explaining the status of the proposal, a summary of the discussion to date, and then links to the actual detailed discussion (in Discourse) about it: https://peps.python.org/pep-0723/ https://peps.python.org/pep-0723/
- noitpmeder 2y agoI see this was accepted (I think?); is the implementation available in a released python version? I don't see an "as of" version on the pep page, nor do lite google searches reveal any official python docs of the feature.
- jonesetc 2y agoIt's not a python the language feature, it's for packaging. So no language version is relevant. It's just there for any tool that wants to use it. uv, an IDE, or anything else that manages virtual environments would be the ones who implement it independent of python versions.
- epistasis 2y agoThis is a specification for Python packaging, which is tooling separate from Python releases (for better or worse, IMHO worse but the BDFL disagrees). There's a box below the Table of Contents of the PEP that points here: https://packaging.python.org/en/latest/specifications/inline-script-metadata/ https://packaging.python.org/en/latest/specifications/inline...
- misiek08 2y agoAnd people were laughing at PHP comments configuring framework, right?
- throwup238 2y agoPython was always the late born twin brother of PHP with better hair and teeth, but the same eyes that peered straight into the depths of the abyss.
- franktankbank 2y agoWhy come types?
- throwup238 2y agoThat’s when each language reached sexual maturity but one went on to get a girlfriend and the other discovered internet porn.
- 8n4vidtmkvmk 2y agoI don't know which is which in this story.
- mkl 2y agoPython was first released in 1991, and PHP was first released in 1995.
- blibble 2y agowith 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
- Spivak 2y agoBecause 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.
- rtpg 2y agoIt's helpful as a way to publish minimal reproductions of bugs and issues in bug reports (compared to "please clone my repo" which has so many layers of friction involved). I would want distributed projects to do things properly, but as a way to shorthand a lot of futzing about? It's excellent