1,370 karma · joined Jan 9, 2009 (17y ago) · 342 submissions
comment 2w ago · link · parent
comment 6mo ago · link · parent
The reference cycle httpx creates is kind of a worst-case scenario for the incremental GC issue. Both the generational (3.13 and older) and incremental GC are triggered by the net new "container" objects (objects that have references to others, like lists and not like ints and floats). The short summary is that you need to create more container objects before the incremental GC triggers. In the case of the httpx reference cycle, you have a relatively small number of container objects hanging on to a lot of memory, due the SSL context data (which is a big memory hog).
Reverting back to the generational GC was the wise thing to do, even though it's a bit scary to do in a bugfix release. The incremental GC works for most people but in the minority of cases it doesn't, it uses quite a lot more memory. I'm pretty sure with some additional tuning, the incremental GC would be fine too but it just didn't get that tuning. The generational GC has literal decades of real-world use (Guido merged my patch on Jun 2000, Tim Peters did a bunch of tuning after that to optimize it).
comment 8mo ago · link · parent
For "normal" Python code, I find mypy does pretty good. Certainly I find it helpful, especially on a large code base and when working with other developers of various experience levels.
The reason I prefer pyrefly over mypy is mostly because of speed. Better accuracy is nice but speed it the killer feature. Given the quality of uv and ruff and the experience of the team working on ty, I'm quite confident it's going to be great in that respect as well.
comment 9mo ago · link · parent
comment 1y ago · link · parent
3.9: 2.78
3.14: 3.86
3.14t: 3.91
This is a silly benchmark though. Look at pyperformance if you want something that might represent real script/application performance. Generally 3.14t is about 0.9x the performance of the default build. That depends on a lot of things though.
comment 1y ago · link · parent
As someone else mentioned, this isn't only about improving efficiency of the government but also about it doing less. So things that currently you would be getting from the government you would no longer be getting. You might agree or disagree with this idea.
Predicting what Trump is going to do is not easy. I don't think he really knows himself each day what he will get up to. Mostly draw a lot of attention to himself, seems the main goal. He's doing fantastic on that front. Regarding policy, he is a lot more purposeful vs his previous term and he is pretty closely following the Project 2025 playbook:
https://old.reddit.com/r/OutOfTheLoop/comments/1itd7xq/whats...
https://docs.google.com/spreadsheets/d/1RHMnJmuv82n6OuY8KYmJ...
Enacting government policy primarily through executive orders is an "interesting" approach. I would say that's not how you want a government to work. Maybe Trump's extreme use of EOs will prompt some reform or maybe it will become the new norm. The other branches of the US government don't seem very interested in actually performing their job.
comment 2y ago · link · parent
https://peps.python.org/pep-0703/#reference-counting
If by GC you mean the cyclic GC, free-threaded Python currently stops all threads while the cyclic GC is running.
comment 2y ago · link · parent
Someone made a great analogy about what is happening here. You have a machine that is supposed to make toy dolls. One day you notice the dolls coming out the machine are deformed and weird looking. So, you say to the doll factory manager:
> I think something is wrong with the doll making machine.
They say
> No, this is a very high quality doll making machine, look at the specifications on the great looking dolls it will make. Don't you trust that this machine will make proper dolls? The manufacturer and people running the machine are all very trustworthy
You say:
> That might be true but I see the dolls coming out are deformed, something must be wrong.
Tim does not get a free pass to behave badly just because he is a long-time Python contributor. However, given his literal decades of civil behavior in many public forums, it is hard to believe he did something that was justifying a ban. Based on looking at what the CoC WG shared and what Tim shared, I don't see anything that justifies it. So, I don't think the "machine" is working correctly.
comment 3y ago · link · parent
As I said in my other comment, Aurélien has strong opinions. He felt he could not effectively work with the other darktable devs and decided to fork the project.
comment 3y ago · link · parent
darktable has seen some major changes in the past few years, moving away from a "display-referred" to a "scene-referred" workflow. Aurélien contributed a lot of code to make that work, most significantly, the Filmic module. darktable is not as user friendly and as polished as other commercial tools (Lightroom, Affinity, Capture One) but it is capable if you take the time to learn it.
comment 3y ago · link · parent
If you want to expand your list a little, here are some additional useful ones: double fisherman's, adjustable grip hitch, sheet bend, trucker's hitch.
Edit: I suppose this is more useful with a little additional commentary. The reef knot is so common that you should know it and know how to avoid the granny knot and also when not to use it (e.g. as a bend). You can use the alpine butterfly as a bend and also for quite few other things. It is more versatile than the bowline (e.g. if you need a loop that doesn't slip) and works fine as a bend (very smiilar to the Zeppelin bend).
comment 3y ago · link · parent
comment 3y ago · link · parent
With DGPS corrections, like you get with the satellite that failed, you get about 10 cm positional accuracy. For dryland crop farming, that's often good enough. It is more accurate than what most human operators can achieve and reduces operator fatigue. So many ag GPS systems are setup to use it out of the box.
There are other solutions, in addition to RTK. Trimble has "CenterPoint". There are Omnistar corrections (different sats, better accuracy than DGPS). Novatel has "GLIDE" but I've never seen it in use.
comment 3y ago · link · parent
To be clear, this is not "PEP 703 – Making the Global Interpreter Lock Optional in CPython", by Sam Gross. PEP 703 is more ambitious and add quite a bit of complexity to the CPython implementation. PEP 684 mostly cleans things up and encapsulates global state better. The most distruptive change is to allow immortal objects. I hope PEP 703 can go in too, even with the downsides (complexity, bit slower single threaded performance).
comment 4y ago · link · parent
comment 4y ago · link · parent
I'm not sure why people are so excited about this issue. It's not much different than sys.setrecursionlimit(). We know how to implement tail recursion. Python doesn't do it though and so there is a limit, set high enough that most people don't care. It seems a perfectly practical approach to me.
comment 4y ago · link · parent
comment 4y ago · link · parent
In a large code base, our team has found type annotations and mypy to be quite helpful. If you are writing a quick-and-dirty script, forget about wasting time with type annotations. However, for long-lived and important code, it seems to be worth adding the types.
Another thing I noticed, if your type annotations are hard to write, e.g. lots "Union", "Optional" or deeply nested type expressions, it's probably a sign that your code is poorly designed. Think about what types you actually want to consume and return. Define new containers using dataclasses or attrs to keep the types simple, if required.
comment 4y ago · link · parent
comment 4y ago · link · parent
There are a number of improvements in the pipeline. Taproot just got enabled. It seems we need something like SIGHASH_ANYPREVOUT (BIP-118) in order to implement eltoo. eltoo would be like the next generation of Lightning, making it easier for users.
comment 4y ago · link · parent
Maybe he was also suggesting that people should generally not be using them. In my experience, it is exceedingly rare to need them. In 29 years of writing Python code, I think I've used them once or twice.