News for hackers. Stuff that matters.
Re:HPy – A better C API for Python by talideon on Sunday October 06, 2024 @07:42AM (#41756431)
If .pth files are the worst thing you can find to complain about, Python's doing pretty well. That horrific .pth file in question is better placed as the feet of its creators than the mechanism itself.
Re:HPy – A better C API for Python by rwmj on Sunday October 06, 2024 @07:58AM (#41756495)
The fact they considered allowing executable code in path lookups shows a certain attitude.
Re:HPy – A better C API for Python by oefrha on Sunday October 06, 2024 @09:32AM (#41757052)
It shows that the language is highly dynamic and you can patch anything? The .pth mechanism allows the party controlling the Python installation (site) to run some init code before any user code, basically an rc mechanism. Nothing more, nothing radical. Maybe you’re unhappy with the dynamism, in which case your complaint is misplaced.
Re:HPy – A better C API for Python by rwmj on Sunday October 06, 2024 @12:52PM (#41758417)
In this case it prevents someone using PYTHONPATH to alter or override the order that modules are loaded. Hard to justify that.
Re:HPy – A better C API for Python by talideon on Monday October 07, 2024 @04:40AM (#41763951)
Again, the blame for that is at the feet of those who wrote the .pth file, not the mechanism itself.
Re:HPy – A better C API for Python by talideon on Monday October 07, 2024 @04:39AM (#41763947)
I searched all my machines and could only find simple ones, all related to some legacy crud for setuptools, one of which was a way to get eggs (which nobody should be using these days) to work.

They're barely a thing these days and mostly a relic from before the end of the Great Setuptools Stagnation and the site package all but discourages their use.

Re:HPy – A better C API for Python by talideon on Monday October 07, 2024 @04:49AM (#41764001)
You'll also be happy to learn that there's an issue open to deprecate them: https://github.com/python/cpython/issues/78125

It's been open since 2018 though. You might find it worth a read.

Re:HPy – A better C API for Python by rwmj on Monday October 07, 2024 @12:56PM (#41768071)
Yup, subscribed to that one already!