Live data from Hacker News

Python 3.15: features that didn't make the headlines

blog.changs.co.uk

141–150 of 236 posts

Re: Python 3.15: features that didn't make the headlines

#141
post #110
post #11

Earlier quoted context omitted.

I think the purpose of go is to write CRUD. Stray from that and you're on your own.

crud is a pretty poor fit for go, you're better served by languages like python that can autogenerate classes that reflect the db schema. go's sweet spot is things like network servers.

Go tooling has this kind of thing as well. I'm not a huge fan of go, but last time I had to work with it, we leveraged a lot of codegen.

Re: Python 3.15: features that didn't make the headlines

#143

Earlier quoted context omitted.

Also C++/Java static initialization, C# static constructors, or Rust global variable initialization, ... Most languages have this feature Afaik

Rust doesn't have this behavior (sometimes called "life before main"). Code to initialize a static variable runs either at compile time, or lazily on first access, depending on which mechanism you use.

Interesting, thanks

Re: Python 3.15: features that didn't make the headlines

#144
post #45

> I've left this one to the bonus section because I've never used set operations on Counters and I'm finding it extremely hard to think of a use case for xor specifically. But I do appreciate the devs adding it for completeness. Check out symmetric difference https://en.wikipedia.org/wiki/Symmetric_difference

Yeah, but applied to counters it would be the symmetric difference between multisets, which doesn't have a natural definition. If I understood the proposal they'd be defining it as absolute value of the difference of the counts, which isn't even associative. If they only considered parities it could be interpreted as addition in F_2, which is more natural, but I'd still agree that it's hard to see how you'd use somet…

You can get the L_k distances between the two counters. E.g. if you sum the absolute value of the difference of the counts, you get the L_1 distance between the counters. If you raise them to the n^th power and then sum them, you get the L_n distance. For n=2, that's the Euclidean distance (squared).

Re: Python 3.15: features that didn't make the headlines

#146

Earlier quoted context omitted.

IMO the main reasons people use Python are: 1. The very first steps are quite simple. Hello world is literally just `print("hello world")`. In other languages it can be a lot more complex. 2. It got a reputation as a beginner-friendly language as a result. 3. It has a "REPL" which means you can type code into a prompt and it will execute it interactively. This is very helpful for research (think AI) where you're tryi…

> * Web sites: Typescript, or maybe Go. lol, no. Just no. Python is far superior for website backends unless perhaps you're running one of the top 20 websites in the world.

Absolute rubbish. The developer experience with something like Fresh is light years ahead of Python even if you completely ignore the performance (which isn't usually a huge issue with websites tbf).

You can generate the HTML server-side using TSX. 100x better than anything Python offers.

Re: Python 3.15: features that didn't make the headlines

#147

Earlier quoted context omitted.

I think this is just a natural consequence of an easy-to-use package system. The exact same story as with node. If you don't want lots of imports, don't make it so damn easy to pile them into projects. I'm frankly surprised we still see so few supply chain attacks, even though they picked up their cadence dramatically.

IIUC the organizations that most strongly pushed for this feature are big companies with large codebases. These tend not to be the kinds of orgs that just casually pull in dependencies from PyPI on a whim; I think it more likely that the quantity of first-party code was so large that importing all of it on startup was causing problems.

I worked in a codebase like this. The load time was insane.

We would also constantly need to put imports in function heads to effectively lazy import due to the massive risk of circular imports. We also had dynamic imports so tracking the cycles was very difficult at times.

Re: Python 3.15: features that didn't make the headlines

#148
post #59

Earlier quoted context omitted.

I'm still on the lookout for a comprehensive Django-like web framework for go. That would be an instant hit for me.

Try another language? The Go ecosystem tends towards libraries as opposed to "frameworks." I personally chose C# for this reason, because ASP.NET is mature and (IMO) well designed. But there's also Java/Spring and and lots of other options in different languages depending on your preferences.

Well it might prefer libraries but the culture around basic DX things like ORMs is toxic. Just write the SQL yourself they say, until they themselves optimise to a half baked in-house ORM of their own.

Re: Python 3.15: features that didn't make the headlines

#149
post #71
post #59

Earlier quoted context omitted.

I'm still on the lookout for a comprehensive Django-like web framework for go. That would be an instant hit for me.

Same here. Django is my last holdout for Python. Everything new is go.

I've found JS/TS Web stacks equally lacking and ugly after Django. I'm totally spoiled by a decade in Django.

Just let me build a CRUD app, on the server, that spits out HTML without an excessive swamp of unmaintained nonsense and a cultish abhorrence of simplicity.

Re: Python 3.15: features that didn't make the headlines

#150
post #82

Earlier quoted context omitted.

I think "Python is slow" is reductive and frankly just as useful as saying "Python begins with a 'P'". The story is more complicated than simply speed of execution. Choosing a language is a game of trade-offs: potentially slower execution in return for faster development time, for example. If your team is already familiar with Ruby, will asking them to write a project in Rust necessarily result in a better product? M…

> potentially slower execution in return for faster development time, for example. Another classic lie about Python. The slower speed doesn't matter because it's development speed that's important, and Python gives you faster development speed! Except... it absolutely doesn't. It would be very difficult to argue that Typescript has significantly slower development speed but it is much faster to execute. I also disagr…

I'm not trying to evangelise. I think the argument that Python is a poor choice because it is "too slow" is based on the assumption that speed of execution always matters. Sure, sometimes it absolutely does, but a lot of the time Python is fast enough.

At risk of nebulous repetition: There are many reasons one might choose a particular language. If you or your team find TypeScript or Go more amenable, by all means, use them.

Post reply on HN