Readit News logoReadit News
squeedles commented on CPython Internals Explained   github.com/zpoint/CPython... · Posted by u/yufiz
lozenge · 12 days ago
That's a standard error clause. In the case PyImport_ImportModule threw a Python exception, you need to Py_DECREF any C local variables which are new references(not borrowed references) and return -1.

From the later call PyModule_AddObject, it's clear this code has come from the PyInit_ module initialisation function. This code is running on import of the C extension to initialise the "FruitEnum" module attribute. https://docs.python.org/3/c-api/extension-modules.html#c.PyI...

squeedles · 12 days ago
Exactly so. I didn't notice that missing def when I put together the blog post, but you are right to call it out. In this case that decref was copypasta from some other code -- I don't decref on the other error returns. I combined code that was in several places and omitted the decref for mod_enum too!

The module init function is where you would normally create the module object (PyModule_Create) and decref it if an error occurs. The blog example is utility code that you would call within the module init function to add an enum.

Someone should really create a blog post compiler to catch these sorts of things :-)

squeedles commented on CPython Internals Explained   github.com/zpoint/CPython... · Posted by u/yufiz
davepeck · 13 days ago
I made some small contributions to cpython during the 3.14 cycle. The codebase is an interesting mix of modern and “90s style” C code.

I found that agentic coding tools were quite good at answering my architectural questions; even when their answers were only half correct, they usually pointed me in the right direction. (I didn’t use AI to write code and I wonder if agentic tools would struggle with certain aspects of the codebase like, for instance, the Cambrian explosion of utility macros used throughout.)

squeedles · 13 days ago
This was around 2021 so AI code tools had not yet eaten everyone. One of the most interesting challenges was finding the right value judgements when blending multiple type systems. I doubt any agentic coding tool could do it today.

I blended the python type system with a large low-level type system (STEP AIM low level types) and a smaller set of higher-level types (STEP ARM, similar to a database view). I already was familiar with STEP, so I needed to really grok what Python was doing under the covers because I needed to virtualize the STEP ARM and AIM access while making it look like "normal" Python.

squeedles commented on CPython Internals Explained   github.com/zpoint/CPython... · Posted by u/yufiz
squeedles · 13 days ago
Had to write a fairly substantial native extension to Python a couple years ago and one of the things I enjoyed was that the details were not easily "Googleable" because implementation results were swamped by language level results.

It took me back to the old days of source diving and accumulated knowledge that you carried around in your head.

https://www.dave.org/posts/20220806_python/

squeedles commented on Parametric CAD in Rust   campedersen.com/vcad... · Posted by u/ecto
throwup238 · 16 days ago
Onshape is just a GUI over the Parasolid geometric modeling kernel, the same kernel used by Solidworks [1]. Whatever their scripting primitives are, they're at best a thin wrapper over Parasolid (which is true for the entire industry - it's all Siemens Parasolid and Dassault ACIS).

[1] https://en.wikipedia.org/wiki/Parasolid#Applications

squeedles · 16 days ago
And both of them were written by Ian Braid, Alan Grayer, and Charles Lang (and others) in Cambridge.

Parasolid was v1 and old school C, then they got the C++ bug like many of us at the time and did ACIS as v2.

squeedles commented on Amazon is ending all inventory commingling as of March 31, 2026   twitter.com/ghhughes/stat... · Posted by u/MrBuddyCasino
squeedles · 25 days ago
Happy to see this. Maybe I'll consider buying toner cartridges again. Every time I've tried in the past, what has shown up has been unusable, sketchy junk. I now go to a neighborhood Staples where I can put actual eyes on the box.
squeedles commented on Local Journalism Is How Democracy Shows Up Close to Home   buckscountybeacon.com/202... · Posted by u/mooreds
squeedles · a month ago
This article should be at the core of any discussion about media concentration. The vast consolidation of radio stations is well known, but the same thing has been happening to small local newspapers. In both cases, you end up with a voice speaking to the public from afar, not local people talking to your community about issues that are important to your neighbors.

At that point, most people just go to the gossip corner of social media and spend the rest of their day being fed six hours of outrage.

squeedles commented on Why your early 2000s photos are probably lost forever   bbc.com/future/article/20... · Posted by u/slyall
socalgal2 · a month ago
I backed up my photos religiously for years. From my first digital camera in like 1995. First to CD-ROMs, then DVD-ROMs, then hard drives, and I included online backups to Google Cloud (real backups via arq, not Google Photos).

My arq bot was running on my 2014 Intel Macbook Pro which would read the photos off my home server and back them up. (the server also being a local backup).

Then I got my M1 Mac and IIRC, arq didn't run there yet or required a newer version that was incompatible with the old or maybe I was just lazy. I don't remember clearly. That was 4 years ago.

Recently I thought I should really get that fixed and get my photos backed up again. My last 4 years of photos are not "backed up" to the cloud. They are backed up to my home server.

AND........ I'm starting to wonder if there is really a point. Do I really need those backups? A podcast I listen to went over how he wanted to leave his cherished books to his kids (all adults). But then he reflected that he didn't really want his dad's books and had the hard realization that his memories of his books are his and his alone and that his kids won't really want his books.

Similarly, my photos and the memories that go with them are almost all mine and mine alone and when I pass away, no one will want them. I actually scanned all of my grandmother's photo books, before she passed away. The majority of those photos have no meaning to me and she's not around to tell me what they are. Of course the ones close family are in have some meaning. Similarly, I scanned my dad's slide collection in like 2005 and none of the photos of him with friends or him with is 2nd wife have any meaning to me.

So, then my question to myself is. Do I really need to back them up more? To go through the trouble of setting up cloud storage, getting backup software working, dealing with the maintainance of that setup. If I lost them would it really be that bad?

Let me add, they are all uploaded to Google Photos, not as backup but as access, and phone based photos are also all auto-uploaded. I'd lose the origanziation I have in my personal backups, and the quality (don't have Google Photos set to full quality).

squeedles · a month ago
I have a digital archive of photos going back to the 1930s, and have physical archives of negatives and slides preserved properly. Not everything is scanned, but it will probably remain on my "to do" list permanently. B/W 114 negs from my grandfather contain many unidentified and unidentifiable people, but there are also views of where I grew up 90 years ago.

I agree with you that a certain portion of images are no longer meaningful, but it's tough to say a-priori what those are. So keep them all. The real problem is that photos often have notes on the back, but digital images rarely have any metadata.

I foresaw this problem back in 2002 and have been using a time-oriented naming convention and keeping little XML files with notes. I posted a little rant about it back in the day and made some simple tooling, which has been good enough to keep some basic notes with my photos.

https://pixtag.org/

squeedles commented on Kroger acknowledges that its bet on robotics went too far   grocerydive.com/news/krog... · Posted by u/JumpCrisscross
imtringued · 2 months ago
Reading these two comments is bizarre from my perspective. How is Amazon competitive with anything? They tend to have higher prices than other online retailers and the intransparent market place system tries to protect shady sellers with product focused reviews instead of seller based reviews. The moment you get even a single fake product or wrong delivery all the perceived savings evaporate at once.

The idea of paying a subscription for the privilege of being scammed sounds ridiculous. The cost of deliveries doesn't magically go down because you're paying a subscription. You're paying for it either way. Either you're overpaying on the subscription because you're not ordering enough or you're overpaying in the form of higher prices that contain the remaining delivery fee.

squeedles · 2 months ago
It's the all you can eat buffet effect. Pay the price and don't have to worry about shipping, can watch (some) streaming without having to worry about paying, and whatever else they decide to roll into their monopoly black hole today.

Sure, if you do a full accounting of costs you may win or lose, but fundamentally people are paying for simplicity. Because almost everyone is lazy, or too busy, or too afraid of random scammers, or whatever, and they played their cards right to become the Sears Catalog from the 19th century in the 21st century.

edit - and one thing that helped them get there is the return policy, so if you get one of those scam sellers, or they sent you wrong crap, opened crap, or just plain everyday crap, you press a couple buttons, maybe drop something off at a UPS store, and problem solved. That definitely shields them from the fallout from their endless listings from sellers like QWERTY123 and ZXCVBN789, and provides an advantage over any other online ordering that doesn't have the same massive advantage of scale.

squeedles commented on Kroger acknowledges that its bet on robotics went too far   grocerydive.com/news/krog... · Posted by u/JumpCrisscross
sokoloff · 2 months ago
Similar shopping story at our house, but I will observe that Home Depot has made amazing strides into competing with Amazon for delivery of items.

They’ll ship me a $10 <thing my project needs> almost always for free and often next day, sometimes same day. And their prices are competitive in general with Amazon and supplyhouse.com.

I don’t know that it’s a great (or even sustainable) offering from their business angle, but I love it as a consumer and DIYer!

squeedles · 2 months ago
I believe that HD (and Lowes) massively subsidizes their delivery ops simply because they don't want to cede the space to Amazon. It allows them to under-stock the stores but still maintain a reasonable range of products. However each time I have ordered, they have delivered a ~$2 part via Fedex, at no extra cost to me.

They are a bigger fish than the mom and pop stores but that just means that it will take a little longer for the Amazon Prime monopoly cash flow to devour it.

squeedles commented on Free software scares normal people   danieldelaney.net/normal/... · Posted by u/cryptophreak
squeedles · 3 months ago
Good article, but the reasoning is wrong. It isn't easy to make a simple interface in the same way that Pascal apologized for writing a long letter because he didn't have time to write a shorter one.

Implementing the UI for one exact use case is not much trouble, but figuring out what that use case is difficult. And defending that use case from the line of people who want "that + this little extra thing", or the "I just need ..." is difficult. It takes a single strong-willed defender, or some sort of onerous management structure, to prevent the interface from quickly devolving back into the million options or schizming into other projects.

Simply put, it is a desirable state, but an unstable one.

u/squeedles

KarmaCake day410March 28, 2024View Original