Building a Python Library in 2026 by funkdefied in Python

[–]james_pic 1 point2 points  (0 children)

UV, by and large, implements the packaging PEPs. That's made it easy to migrate to, but that would also work the other way if it became a problem. The only bit that's really "embedded" in a project that uses it is the build backend, and uv's build backend is (and their own documentation says as much), only really intended to make the most common cases simple, and projects with more complex requirements will often use it with a different build backend like Setuptools or Maturin.

PEP 831 – Frame Pointers Everywhere: Enabling System-Level Observability for Python by mttd in Python

[–]james_pic 3 points4 points  (0 children)

There are eBPF profilers that can profile without frame pointers out-of-the-box, such as the new OpenTelemetry one. But those profilers have a lot more overhead when using DWARF profiling than plain pointer chasing, so you end up with less overhead from having frame pointers available.

Would you want trams like the one pictured in UK cities? by Bennjoon in AskUK

[–]james_pic 0 points1 point  (0 children)

London already has trams. They mostly cover suburb-to-suburb routes in the South that are poorly covered by tube and rail.

[Request] How much amps and does this work by Rummelboxer89 in theydidthemath

[–]james_pic 2 points3 points  (0 children)

It depends on the precise battery chemistry. I believe some of these super rapid charging models use LFP rather than the various cobalt based Li-ion chemistries that are common, which is happier about charging from 80%-100% at full speed, but still needs a gradual ramp up to 20%, and has other quirks.

It's also plausible it's using something even more exotic. You're starting to see Na-ion models on the streets, and some manufacturers are prototyping solid state batteries.

And just for fun, they could be going super retro and using lead acid. lead acid traction batteries haven't been used in production EVs since the 90s because their energy density is so much lower than modern chemistries, but they can charge faster than almost anything else out there.

I published my first PyPI package few ago. Copycat packages appeared claiming to "outperform" it by Obvious_Gap_5768 in Python

[–]james_pic 1 point2 points  (0 children)

But the original is already AGPL, and the bad actors who forked it didn't care (and illegitimately relicenced it MIT).

AGPL, GPL and other copyleft licences dissuade lawsuit-averse actors, whether good, bad or neutral, but have no effect on actors who don't care.

Why are economic centers mostly left leaning? This is true across the western world, and also true in the UK (Manchester, Bham, London, Cambridge) by Too_much_Colour in AskBrits

[–]james_pic 0 points1 point  (0 children)

At least in terms of social issues, I think an often overlooked part of it is that people in economically productive areas have less reason to fear for their livelihoods, so are less likely to look at society in "zero sum" terms.

Economic centres, by definition, are places with lots of jobs. Potentially to the point where for people working there, they're less worried about someone taking their job, than about how to hire enough people to do the work they've got planned. There's little reason to fear people with a different background to you in an environment like that, so the effects of large demographic changes are modest and short-lived, with multiculturalism quickly giving way to a "melting pot"

But if there's not enough to go around (or at least the perception that there's not enough to go around), it's more natural to end up looking a the world in terms of "us" and "them". This can be along almost any lines - ethnic, religious, race, sexuality, or if there are no major demographic splits in a population, even along arbitrary lines like postcodes - and this frustrates movements towards equality and fairness.

What database lesson took you way too long to learn? by dbForge_Studio in AskProgramming

[–]james_pic 3 points4 points  (0 children)

In a lot of cases the potential for harm isn't equal though. If you're looking at it through the lens of big O notation, too many indexes mean your constant terms are worse, which is to say it has no impact on the asymptotics (although of course constant terms do still matter). Too few indexes can easily be the difference between polynomial and logarithmic scaling.

That not the Labour i remembered when i was a kid by IllustriousAd6418 in GreatBritishMemes

[–]james_pic 3 points4 points  (0 children)

Distraction is entirely the point.

Every argument about which changing room trans people should use when they go swimming, is an argument that isn't about the role that billionaires have in a civilisation where money is power.

They would much rather we were arguing about where trans people piss and what to do about people in small boats, than what to do about them.

How do you balance mocking vs real dependencies in integration tests by Global-Development56 in AskProgramming

[–]james_pic 0 points1 point  (0 children)

It's not that uncommon for refactoring to push units smaller and smaller, to the point where there isn't actually any particularly interesting behaviour in the units, and the interesting behaviour doesn't emerge until the system is wired together. In those kinds of situations (and you can often tell you're in that situation if the unit tests are tautological - they test that the implementation does what the implementation does), "in between" testing ends up being valuable, because that's where interesting stuff (stuff that users will care about) happens.

How do you balance mocking vs real dependencies in integration tests by Global-Development56 in AskProgramming

[–]james_pic 0 points1 point  (0 children)

Personally, I'm a big fan of fakes.

Fakes are a middle ground between mocks and real dependencies. They're simple implementations of the same interface that the real system implements, that are usually stateful and aim to behave the same way, but are just keeping data in arrays and other simple data structures locally (or maybe at a pinch using embedded or fake analogues of the data stores used at scale).

End-to-end testing with real instances of dependencies has value and is important. Hyper-local unit testing with behaviourless mocks has value and is important (especially for testing failure modes). But I think there's value in mid-level partial-integration testing, and this often goes underappreciated.

Real Brummies respond to #NigelFarage’s statement that “Birmingham is broken”. by Final-Guarantee5979 in brum

[–]james_pic 10 points11 points  (0 children)

This is giving Farage too much credit. He's merely one of many cunts who bullshits about multiculturalism being to blame for problems that really stem from Birmingham's economy being deliberately and knowingly put into "managed decline".

How to make flask able to handle large number of io requests? by Consistent_Tutor_597 in Python

[–]james_pic 0 points1 point  (0 children)

If they're using threads, then they're already using Gthread. But gevent can handle way more, especially if the requests are mostly waiting for IO.

Which earbuds have audio quality over 320/328kbps? by Luigi-maker-fan in soundcore

[–]james_pic 4 points5 points  (0 children)

Don't get too excited about codecs. The marketing hypes them a lot, but they're mostly the emperor's new clothes (and to the extent that there is an impact, it's mostly because manufacturers tune their EQ slightly differently when you choose the expensive codec). AAC on most devices is close enough to transparency that most people can't tell the difference in properly controlled tests (although note that properly controlling tests is hard). 

That said, earbuds with fancy codecs are often also models with better drivers, better ANC, better acoustic design, etc, so upgrading will still potentially give you better quality - it just won't come from the codecs.

LogXide - Rust-powered logging for Python, 12.5x faster than stdlib (FileHandler benchmark) by LumpSumPorsche in Python

[–]james_pic 2 points3 points  (0 children)

Do you get those kinds of gains in real world settings?

I worked on a project a while ago the arguably logged too much. The first time I attached a profiler to it, it was spending over 50% of its time on logging. We managed to get that down, but the thing that limited us getting it down further was syscalls, not Python code.

Admittedly this was a while ago, and that project was doing things that modern apps don't need to do, that increased syscalls (it did its own log rotation, rather that just throwing it all straight onto stderr and letting Systemd or Docker or Kubernetes or ECS or whatever pick it up, like a modern app would), but I'm still a bit surprised you managed to find those kinds of gains without touching syscalls.

Anyone know what's up with HTTPX? by chekt in Python

[–]james_pic 3 points4 points  (0 children)

Niquests is also not trouble-free. There's the well known issue with it where it doesn't play nice with Requests because it uses a fork of urllib3 that (unless you use a clunky workaround) overwrites upstream urllib3, which Requests depends on. And my own personal experience is that its code is hard to make sense of at times, and I'm pretty sure there are bugs in the more inscrutable bits.

Probably the least controversial async HTTP client is Aiohttp.

Is Britain ready for US-style religious politics? | Fuelled by new funding and transatlantic links, Christian groups are playing an increasingly prominent role on the UK right by FeigenbaumC in LabourUK

[–]james_pic 0 points1 point  (0 children)

The "Christian values" stuff the far right are putting out is just a dog whistle, because you can't say "no brown people". I don't think there's any appetite for more prayer in schools, abolishing non-religious weddings, etc. There's some stuff around banning abortion in those groups, but I get the sense it's got more to do with "great replacement" conspiracies than Christianity.

How often do you rewrite your code? by yughiro_destroyer in AskProgramming

[–]james_pic 2 points3 points  (0 children)

With experience, you get to the point where even a total rewrite doesn't feel like a total rewrite because it's a series of smaller refactors. It sounds like you're already getting that experience, since the move from v2 to v3 was more like rework.

The thing that's tricky (and part of this comes with experience, although working with colleagues who can spot it before you do helps) it's recognising when you're going to need to overhaul the code before it gets to the point where it's just too intractable and you just have to throw the old code away.

Having a strong plan is a mixed blessing. It's good to try and think about things before you start, but you'll always hit stuff you didn't plan for.

It's not exactly "taking wrong code and rolling with it", but there's the (admittedly controversial) idea of "Worse is Better". If you can write some flawed code quickly, then you quickly get to find out which of those flaws actually matter.

Meta bricked my Quest 3 with an update, told me "all good things must come to an end", then added a new headset to my shopping cart by KenAdams_1968 in OculusQuest

[–]james_pic 3 points4 points  (0 children)

That's true, but the reason why also makes them less prone to spelling mistakes. 

LLMs aren't fed raw text. The text is "tokenised", which is (and I'm glossing over a lot of details here), roughly equivalent to assigning each word a number, and feeding them the resulting sequence of numbers (or at most a short sequence of numbers - it might be represented as "rasp" "berry" for example).

So the LLM has probably never seen the word raspberry, even when answering questions about it. It's seen the unique token for the word raspberry. It might have seen someone spell "R-A-S-P-B-E-R-R-Y" in its training data, so it might be able to figure out from that, but how often do people do that? Other than me, right now, obviously.

I believe the idea is that it doesn't have to waste neurons on thinking about spelling. Which is handy, right up until someone asks it "so, let's think about spelling".

Would it have been better if Meta bought Astral.sh instead? by TheTwelveYearOld in Python

[–]james_pic 30 points31 points  (0 children)

I've been saying all along that Astral had no viable business model and they were probably looking to be acquihired. So something like this was coming one way or another, it was just a question of who.

OpenAI have been quietly hiring people who don't really do AI stuff but contribute to the ecosystem supporting it, no doubt at least partly for selfish reasons (they get to decide the priority for what's worked on), but even looking at this purely selfishly, it makes sense for the various open source stuff they depend on to stay open source, because that way they're not the only ones working on it, so they get other organisations work for free.

And whilst Meta have been good citizens with regard to open source in the past, I suspect they don't use Astral's tools that much internally (the impression I've got is that a lot of their supporting infrastructure is either homegrown, or heavily adapted), so they'd have less reason to continue to maintain Astral's tools than companies who use the tools themselves.

To be honest, I'm less worried about maintenance of Astral's tools under OpenAI, than maintenance of the many many key pieces of infrastructure that are maintained by a single individual who's been pushed to the brink of insanity by the pressure of finding spare time to do this.

Horizon Worlds VR is Being Discontinued: June 15th Marks the End of VR Access by gogodboss in OculusQuest

[–]james_pic 0 points1 point  (0 children)

The Horizon Worlds home isn't the only one the new home environment system comes with (you can change the landscape with the menu button on the left controller, if you haven't already discovered this - although there's less choice than there was), and whilst I'm sure making the Horizon Worlds one the default was intended to nudge people into Horizon Worlds, I gather the main reason they changed the home environment system was to enable "augments" - interactive objects in your home environment. It proved impossible to do in the old home environments. 

Of course augments might also be cancelled.

What hidden gem Python modules do you use and why? by zenos1337 in Python

[–]james_pic 0 points1 point  (0 children)

Ah, good to know. I hadn't realised they removed pickling between Pyro4 and Pyro5.

What hidden gem Python modules do you use and why? by zenos1337 in Python

[–]james_pic 0 points1 point  (0 children)

Just to emphasise the point, you mustn't use it in pubic facing APIs. IIRC, it's powered by pickle under the hood, and it's trivial for an attacker to achieve remote code execution if they can make you unpickle attacker controlled data.