
2025-06-06 11:33:00
heise | Python-Grundlagen: Wie Sie for-Schleifen richtig einsetzen
for-Schleifen gehören zu den grundlegenden Konzepten in der Programmierung. Richtig eingesetzt sparen sie sehr viele Codezeilen.
h…
heise | Python-Grundlagen: Wie Sie for-Schleifen richtig einsetzen
for-Schleifen gehören zu den grundlegenden Konzepten in der Programmierung. Richtig eingesetzt sparen sie sehr viele Codezeilen.
h…
Okay, spent a little time with Python's Matplotlib to get this graph of miles biked so far this year...
At some point I should be able to pull the data from Run Gap's SQLite database to automate this more, and get more granular.
I still need to figure out how to space the bars and some other formatting stuff but it's a good start!
#python
#Python Friday #282: Working With Temporary Files
https://pythonfriday.dev/2025/06/282-working-with-temporary-files/
VisCoder: Fine-Tuning LLMs for Executable Python Visualization Code Generation
Yuansheng Ni, Ping Nie, Kai Zou, Xiang Yue, Wenhu Chen
https://arxiv.org/abs/2506.03930
IntLevPy: A Python library to classify and model intermittent and L\'evy processes
Shailendra Bhandari, Pedro Lencastre, Sergiy Denysov, Yurii Bystryk, Pedro G. Lind
https://arxiv.org/abs/2506.03729
So #Gentoo #Python eclasses are pretty modern, in the sense that they tend to follow the best practices and standards, and eventually deal with deprecations. Nevertheless, they have a long history and carry quite some historical burden, particularly regarding to naming.
The key point is that the eclasses were conceived as a replacement for the old eclasses: "distutils" and "python". Hence, much like we revision ebuilds, I've named the matching eclasses "distutils-r1" and "python-r1". For consistency, I've also used the "-r1" suffix for the remaining eclasses introduced at the time: "python-any-r1", "python-single-r1" and "python-utils-r1" — even though there were never "r0"s.
It didn't take long to realize my first mistake. I've made the multi-impl eclass effectively the "main" eclass, probably largely inspired by the previous Gentoo recommendations. However, in the end I've found out that for the most use cases (i.e. where "distutils-r1" is not involved), there is no real need for multi-impl, and it makes things much harder. So if I were naming them today, I would have named it "python-multi", to indicate the specific use case — and either avoid designating a default at all, or made "python-single" the default.
What aged even worse is the "distutils-r1" eclass. Admittedly, back when it was conceived, distutils was still largely a thing — and there were people (like me) who avoided unnecessary dependency on setuptools. Of course, nowadays it has been entirely devoured by setuptools, and with #PEP517 even "setuptools" wouldn't be a good name anymore. Nowadays, people are getting confused why they are supposed to use "distutils-r1" for, say, Hatchling.
Admittedly, this is something I could have done differently — PEP517 support was a major migration, and involved an explicit switch. Instead of adding DISTUTILS_USE_PEP517 (what a self-contradictory name) variable, I could have forked the eclass. Why didn't I do that? Because there used to be a lot of code shared between the two paths. Of course, over time they diverged more, and eventually I've dropped the legacy support — but the opportunity to rename was lost.
In fact, as a semi-related fact, I've recognized another design problem with the eclass earlier — I should have gone for two eclasses rather than one: a "python-phase" eclass with generic sub-phase support, and a "distutils" (or later "python-pep517") implementing default sub-phases for the common backends. And again, this is precisely how I could have solved the code reuse problem when I introduced PEP517 support.
But then, I didn't anticipate how the eclasses would end up looking like in the end — and I can't really predict what new challenges the Python ecosystem is going to bring us. And I think it's too late to rename or split stuff — too much busywork on everyone.
I wrote a little tool to show what "board.*" defines for a #CircuitPython build. I got tired for always trawling through ports/*/boards for it. It's called "cirpy-showpins" and its output looks like the below. I used #Perl originally but here's it in Python:
I wrote a little tool to show what "board.*" defines for a #CircuitPython build. I got tired for always trawling through ports/*/boards for it. It's called "cirpy-showpins" and its output looks like the below. I used #Perl originally but here's it in Python:
Mein Vortrag für die Tübix wurde angenommen:
Wie uns LLMs beim Programmieren helfen
#LLM
"Professor Cain uses various programming languages to explain these concepts: he starts with C (roughly from the second lecture to the 8th), then Assembly (lectures 9 to 11), C (lectures 12 to 18), Scheme (lectures 19 to 23), and Python (from 24 to 26). The last lecture (27) dives into some other functional programming languages like ML, Miranda, and even Haskell, as well as some advanced type design concepts, to round up your general programming knowledge."
This https://arxiv.org/abs/2505.22652 has been replaced.
initial toot: https://mastoxiv.page/@arXiv_mat…
from my link log —
The first year of free-threaded Python.
https://labs.quansight.org/blog/free-threaded-one-year-recap
saved 2025-05-14
exoatlas: friendly Python code for exoplanet populations
Zach K. Berta-Thompson, Patcharapol Wachiraphan, Autumn Stephens, Mirielle Caradonna, Catriona Murray, Valerie Arriero, Jackson Avery, Girish M. Duvvuri, Sebastian Pineda
https://arxiv.org/abs/2507.02210
Video tutorials for modern ideas and open source tools. #python
I've been asked to run an AI text summariser over a bunch of survey responses. I'm skeptical anyway, so probably approaching the task with a bad attitude, but none of the open source AI text summarisers I've tried so far actually run at all, due to the usual Python bit-rot and lack of stable libraries.
Tried AI-News-Summariser, sumeval, ParaSum, SummerTime... currently trying Transformers, but it's taking an age to install.
Can anyone suggest one which at least ru…
This https://arxiv.org/abs/2502.00278 has been replaced.
initial toot: https://mastoxiv.page/@arXiv_…
Precisely Detecting Python Type Errors via LLM-based Unit Test Generation
Chen Yang, Ziqi Wang, Yanjie Jiang, Lin Yang, Yuteng Zheng, Jianyi Zhou, Junjie Chen
https://arxiv.org/abs/2507.02318
Released v0.20.0 of the ha-mqtt-discoverable python module.
This is a pure-python library for creating #MQTT entities that will be automatically detected by #HomeAssistant
Added a 'set_blob' method to the Image class to allow publication of images directly from code. HA will take base64 encoded images directly via MQTT
Details at https://github.com/unixorn/ha-mqtt-discoverable/releases/tag/v0.20.0
@…
hdl2v: A Code Translation Dataset for Enhanced LLM Verilog Generation
Charles Hong, Brendan Roberts, Huijae An, Alex Um, Advay Ratan, Yakun Sophia Shao
https://arxiv.org/abs/2506.04544
One of the goals I've set for further development of #Python eclasses in #Gentoo was to avoid needless complexity. Unfortunately, the subject matter sometimes requires them. However, many of the functions added lately were already manually done in ebuilds for years.
We've started disabling plugin autoloading years ago. First we just did that for individual packages that caused issues. Then, for these where tests ended up being really slow. Finally, pretty much anywhere `python_test()` was declared. Doing it all manually was particularly cumbersome — all I needed for `EPYTEST_PLUGINS` is a good idea how to generalize it.
Similarly, `EPYTEST_XDIST` was added after we have been adding manually `epytest -p xdist -n "$(makeopts_jobs)" --dist=worksteal` — and while at it, I've added `EPYTEST_JOBS` to override the job count.
Perhaps `EPYTEST_TIMEOUT` wasn't that common. However, it was meant to help CI systems that could otherwise get stuck on hanging test.
Similarly, "standard library" version (like `3.9`) matching to `python_gen_cond_dep` was added after a long period of explicitly stating `python3_9 pypy3`. As an extra benefit, this also resolved the problem that at the time `pypy3` could mean different Python versions.
python_dependency: Python Dependency Network
Python's package dependency networks. Nodes in the network are Python's packages registered to PyPI and edges are dependencies among packages.
This network has 58743 nodes and 108399 edges.
Tags: Technological, Software, Unweighted
https://networks.sk…
Lazy internet: Does anyone know of a Python (or other if it’s easy enough to configure) filtering RSS proxy? Instead of pointing my feed reader to example.com/rss, I’d point it at my server which would get that feed, filtering out things I don’t want to see.
I'm happy to announce structlog 25.4.0 that adds support for exception groups but more importantly fixes an incompatibility with the upcoming Python 3.13.4
https://github.com/hynek/structlog/releases/tag/25.4.0
5. Another very minor thing: there's no way of rebuilding your existing Spoti-Tidal-Apple playlists to Navidrome (using your library's existing files) or transferring your iTunes listen counts out of the box. I *was* able to find a nice Python script thing for the playlists, but I had to transfer my Tidal playlists to Spotify first:
Pyrefly vs. ty: Comparing Python’s Two New Rust-Based Type Checkers
#types
AutoLyap: A Python package for computer-assisted Lyapunov analyses for first-order methods
Manu Upadhyaya, Adrien B. Taylor, Sebastian Banert, Pontus Giselsson
https://arxiv.org/abs/2506.24076
from my link log —
Sneak peek: A new ASN.1 API for Python.
https://blog.trailofbits.com/2025/04/18/sneak-peek-a-new-asn.1-api-for-python/
saved 2025-04-18
Ark: An Open-source Python-based Framework for Robot Learning
Magnus Dierking, Christopher E. Mower, Sarthak Das, Huang Helong, Jiacheng Qiu, Cody Reading, Wei Chen, Huidong Liang, Huang Guowei, Jan Peters, Quan Xingyue, Jun Wang, Haitham Bou-Ammar
https://arxiv.org/abs/2506.21628
It's a small thing, the syntactic sugar of using `/` to concatenate paths and strings is reason enough to use pathlib. And then you find out about all the built in methods...
https://mastodon.social/@treyhunner/114778741547764668
Mate, this parrot wouldn't VOOM if you put four million volts through it!
-- Monty Python
Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges
Lajos Muzsai, David Imolai, Andr\'as Luk\'acs
https://arxiv.org/abs/2506.02048
#Python Friday #277: Access Local #LLMs Through LM Studio
https://pythonfriday.dev/2025/05/277-a
eACGM: Non-instrumented Performance Tracing and Anomaly Detection towards Machine Learning Systems
Ruilin Xu, Zongxuan Xie, Pengfei Chen
https://arxiv.org/abs/2506.02007
The Python-based data-exfiltration utility used by the Cl0p ransomware group (commonly distributed as part of the toolset during the 2023 – 2024 MoveIt campaigns) constructs operating-system commands by directly concatenating attacker-supplied strings without input sanitization. An authenticated endpoint on the Cl0p operators’ staging/collection host passes file-or directory-names received from compromised machines straight into a shell-escape sequence. No official patch or cooperation from …
Replaced article(s) found for cs.LG. https://arxiv.org/list/cs.LG/new
[2/5]:
- optimizn: a Python Library for Developing Customized Optimization Algorithms
Akshay Sathiya, Rohit Pandey
This https://arxiv.org/abs/2501.07973 has been replaced.
initial toot: https://mastoxiv.page/@arX…
Bugs in the Shadows: Static Detection of Faulty Python Refactorings
Jonhnanthan Oliveira, Rohit Gheyi, M\'arcio Ribeiro, Alessandro Garcia
https://arxiv.org/abs/2507.01103
In case anyone here has connections with the Python team: can you please tell them to update their docs on XML security? The way it is is quite misleading, and it's been annoying me for a while. I raised this a while ago in their issue tracker, but it got no reaction whatsoever. https://github.com/python/cpython/issu…
Not upgrading all the SQS code using boto.sqs.Message to boto3 has finally bitten me on the ass as boto just doesn't work on Python 3.12 which is what I'm moving to.
And I'm moving it because 3.7 has become the 2.7 of Python 3. Whilst I originally targeted 3.9 that is slipping away too.
There is a lot of SQS going on, not just pipelining but logging. The logging is kind of Schroedinger logging as I don't bother with it unless I need to.
Geoff: The Generic Optimization Framework & Frontend for Particle Accelerator Controls
Penelope Madysa, Sabrina Appel, Verena Kain, Michael Schenk
https://arxiv.org/abs/2506.03796
sad :3 https://github.com/qilingframework/qiling/issues/253
someone's gotta retry ^^
This https://arxiv.org/abs/2404.07249 has been replaced.
initial toot: https://mastoxiv.page/@arXiv_…
I still need to get around to automating this stuff a bit more, but for now I just type a few numbers each month for my biking stats...
#bikeTooter #python
Classification of Hoyle State Decay Branches in Active Target Time Projection Chamber using Neural Network
Pralay Kumar Das, Nayana Majumdar, Supratik Mukhopadhyay
https://arxiv.org/abs/2506.02506
Resolvent4py: a parallel Python package for analysis, model reduction and control of large-scale linear systems
Alberto Padovan, Vishal Anantharaman, Clarence W. Rowley, Blaine Vollmer, Tim Colonius, Daniel J. Bodony
https://arxiv.org/abs/2506.20539
Finite-size security analysis for quantum protocols: A Python framework using the Entropy Accumulation Theorem with graphical interface
Piotr Mironowicz, Mohamed Bourennane
https://arxiv.org/abs/2506.18888
SPAC: A Python Package for Spatial Single-Cell Analysis of Multiplex Imaging
Fang Liu, Rui He, Andrei Bombin, Ahmad B. Abdallah, Omar Eldaghar, Tommy R. Sheeley, Sam E. Ying, George Zaki
https://arxiv.org/abs/2506.01560
🚚 Move your #Azure resources across subscriptions or resource groups—without downtime!
Use CLI, PowerShell, Python, or REST API to stay flexible and in control. ⚙️📦 Just update those resource IDs! #CloudManagement
Learn more:
gcor: A Python Implementation of Categorical Gini Correlation and Its Inference
Sameera Hewage
https://arxiv.org/abs/2506.19230 https://
Combining Type Inference and Automated Unit Test Generation for Python
Lukas Krodinger, Stephan Lukasczyk, Gordon Fraser
https://arxiv.org/abs/2507.01477 h…
A while ago, I've followed the example given by #Fedora and unbundled ensurepip wheels from #Python in #Gentoo (just checked — "a while ago" was 3 years ago). This had the important advantage that it enabled us to update these wheels along with the actual pip and setuptools packages, meaning new virtual environments would get fresh versions rather than whatever CPython happened to bundle at the time of release.
I had considered using our system packages to prepare these wheels, but since we were already unbundling dependencies back then, that couldn't work. So I just went with fetching upstream wheels from PyPI. Why not build them from source instead? Well, besides feeling unnecessary (it's not like the PyPI wheels are actually binary packages), we probably didn't have the right kind of eclass support for that at the time.
Inspired by @…, today I've tried preparing new revisions of ensurepip packages that actually do build everything from source. So what changed, and why should building from source matter now? Firstly, as part of the wheel reuse patches, we do have a reasonably clean architecture to grab the wheels created as part of the PEP517 build. Secondly, since we're unbundling dependencies from pip and setuptools, we're effectively testing different packages than these installed as ensurepip wheels — and so it would be meaningful to test both variants. Thirdly, building from source is going to make patching easier, and at the very least enable user patching.
While at it, I've refreshed the test suite runs in all three regular packages (pip, setuptools and wheel — we need an "ensurepip" wheel for the last because of test suites). And of course, I hit some test failures in testing the versions with bundled dependencies, and I've discovered a random bug in #PyPy.
https://github.com/gentoo/gentoo/pull/42882 (yes, we haven't moved yet)
https://github.com/pypy/pypy/issues/5306
Jumping between node (my blog) and python (frontmatter changes) today was fun but I made an oops with #activepieces 😂 which then required more python (bulk deletes) which then required making edits to mastodon/config/initializers
/rack_attack.rb
Sorry to those I spammed on the #Fediverse
Eventual, which develops Daft, a Python-native open-source data processing engine, raised a $7.5M seed led by CRV and a $20M Series A led by Felicis (Rebecca Szkutak/TechCrunch)
https://techcrunch.com/2025/06/24/how-a-data-pro…
TIL that #Python's strptime can't handle unix timestamps, wtf... 😑
time.strptime("1750420325","%s")
ValueError: 's' is a bad directive
(Yes, I know there's datetime.fromtimestamp, but here I'd much prefer to keep everything with %Y %m %d et al. due to reasons)
Sorrel: A simple and flexible framework for multi-agent reinforcement learning
Rebekah A. Gelp\'i, Yibing Ju, Ethan C. Jackson, Yikai Tang, Shon Verch, Claas Voelcker, William A. Cunningham
https://arxiv.org/abs/2506.00228
I've just tagged build-and-inspect-python-package 2.13.0 of my popular GitHub Action.
It now offers the package name as an output and uses it in the job summary which should be useful to people building multiple packages at once.
https://github.com/hynek/build-and-ins
CPN-Py: A Python-Based Tool for Modeling and Analyzing Colored Petri Nets
Alessandro Berti, Wil M. P. van der Aalst
https://arxiv.org/abs/2506.12238 https:…
Replaced article(s) found for cs.NI. https://arxiv.org/list/cs.NI/new
[1/1]:
- ECLYPSE: a Python Framework for Simulation and Emulation of the Cloud-Edge Continuum
Jacopo Massa, Valerio De Caro, Stefano Forti, Patrizio Dazzi, Davide Bacciu, Antonio Brogi
Numerical solution of the Lindblad master equation using the Runge-Kutta method implemented in Python
Leonardi Hern\'andez S\'anchez, Iv\'an Alejandro Bocanegra Garay, Ariel Flores Rosas, Ir\'an Ramos Prieto, Francisco Soto Eguibar, H\'ector Manuel Moya Cessa
https://arxiv.org/abs/2506.19238
'Beneath the surface of external dominance lies an “invisible” European strength: a long-standing presence in open-source software (OSS) and open standards that form the backbone of critical digital infrastructures. From Linux and Python to core internet protocols, Europe has made significant
contributions to open source initiatives.'
3/n
Asked 5 different local AIs (not internet based nor connecting to the internet):
What is the average airspeed of a fully laden swallow?
And they attributed it to 3 novels: Alan Sillitoe's "The Lonely Voice"(which does not exist), Douglas Adams's "A Hitchhiker's Guide to the Galaxy," George Orwell's "Animal Farm" and also the correct answer, the movie Monty Python and the Holy Grail.
So as long as we're good with AI being 75%…
Released 0.19.2 of ha-mqtt-discoverable.
This is a pure-python library for creating #MQTT entities that will be automatically detected by #HomeAssistant
https://github.com/unixorn/ha-mqtt-discoverable/releases
Fixes Select behavior (Thanks mhentschke!)
@…
Verification of Hamiltonian Path Conjecture (BHR Conjecture) for Integers up to p=31
Ranjan N Naik
https://arxiv.org/abs/2507.00059 https://
Learning with pyCub: A New Simulation and Exercise Framework for Humanoid Robotics
Lukas Rustler, Matej Hoffmann
https://arxiv.org/abs/2506.01756 https://
Paczka Pythona, której nie idzie zainstalować na Pythonie 3.14, bo autor koniecznie musiał zaimplementować przetwarzanie AST na ponad 200 linii w `setup.py`? Dlaczego nie.
#Gentoo #Python #setuptools
Replaced article(s) found for math.OC. https://arxiv.org/list/math.OC/new
[2/2]:
- optimizn: a Python Library for Developing Customized Optimization Algorithms
Akshay Sathiya, Rohit Pandey
New reason not to use #PythonPoetry just dropped: they reinvented "reproducible builds", poorly. The problem is, they missed the purpose of reproducible builds entirely and they use it for source distributions too, and when you don't use SOURCE_DATE_EPOCH, they force all files to epoch (as in timestamp 0) instead of leaving them alone.
Like, all source distributions created by Poetry and uploaded to #PyPI now have 1970 timestamps that, simply speaking, break stuff. The most absurd thing is that ZIP can't handle that timestamp, so they override it and use another date for wheels 🤦.
#Gentoo #PEP517
#Python Friday #283: Play Audio Files in Python
https://pythonfriday.dev/2025/06/283-play-audio-files-in-python/
Having a bizarre Python performance issue:
same program running on three systems. On the system which has the best Python benchmark scores, it performs the worst. On the oldest system with the worst Python benchmark scores, it performs the best. The worst and best systems are both Ryzen 7 zen4 and zen3 running openSUSE TW; the middle child is a 2020 MacBook Air M1.
wtf?
PyRigi -- a general-purpose Python package for the rigidity and flexibility of bar-and-joint frameworks
Matteo Gallet, Georg Grasegger, Matthias Himmelmann, Jan Legersk\'y
https://arxiv.org/abs/2505.22652
from my link log —
A Rust API inspired by Python, powered by Serde.
https://ohadravid.github.io/posts/2025-05-serde-reflect/
saved 2025-05-15
On the way to the PyConDE in Darmstadt. I look forward to hopefully see you soon.
@… #Python
sweet setup.py you've got there for your pure-python project. i, too, am a big fan of the 1990s.
#Python Friday #279: Sentiment Analysis in Python - #ai
https://pythonfriday.dev/2025/05/279-s
When you spend an hour backporting #CPython #security fixes to all versions of #Python #Gentoo, because there was no planned security release, and a few hours later you spend time again bumping to the unexpected security releases.
And then you are surprised why you didn't mask Python 3.8 yet, and repeat the same mistake.
Oh, and ofc update your CPython and PyPy (fixed PyPy only in Gentoo).
TasVisAn and InsPy -- Python Packages for Triple-Axis Spectrometer Data Visualization, Analysis, Instrument Resolution Calculation, and Convolution
Guochu Deng
https://arxiv.org/abs/2506.18216
An Algorithm for Automated Extraction of Resonance Parameters from the Stabilization Method
Johanna Langner, Anjan Sadhukhan, Jayanta K. Saha, Henryk A. Witek
https://arxiv.org/abs/2507.01382
Poster: libdebug, Build Your Own Debugger for a Better (Hello) World
Gabriele Digregorio, Roberto Alessandro Bertolini, Francesco Panebianco, Mario Polino
https://arxiv.org/abs/2506.02667
Dzisiejsi programiści: "zgoda? po co nam zgoda, po prostu nadpiszemy ci wszystkie menadżery paczek Pythona — naszą paczką. Co może pójść nie tak?!"
A dowcip w tym taki, że ja nawet tego tak naprawdę nie zainstalowałem — tylko robiłem przypadkowe poprawki, i uruchomiłem testy w venvie.
https://github…
CODEMENV: Benchmarking Large Language Models on Code Migration
Keyuan Cheng, Xudong Shen, Yihao Yang, Tengyue Wang, Yang Cao, Muhammad Asif Ali, Hanbin Wang, Lijie Hu, Di Wang
https://arxiv.org/abs/2506.00894
Modern programmers: "oh, let's hijack all #Python package managers in your bashrc without asking for consent, what could possibly go wrong."
And the best joke is, I didn't even really install the package — I was just making a random bugfix and running its test suite in a virtual environment.
#Gentoo #security
Biblioteki eclass związane z Pythonem w #Gentoo są całkiem aktualne. Stosują się do aktualnych zaleceń i standardów, i usuwają na bieżąco rzeczy przestarzałe. Niemniej, mają za sobą długą historię, i najlepiej chyba to widać po nazewnictwie.
Biblioteki te powstały w celu zastąpienia wcześniejszych "distutils" i "python". Dlatego też nazwałem je odpowiednio "distutils-r1&…
Quality Assessment of Python Tests Generated by Large Language Models
Victor Alves, Carla Bezerra, Ivan Machado, Larissa Rocha, T\'assio Virg\'inio, Publio Silva
https://arxiv.org/abs/2506.14297