Live data from Hacker News

Python 3.15: features that didn't make the headlines

blog.changs.co.uk

231–236 of 236 posts

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

#231

Earlier quoted context omitted.

No, that is not TypeScript. That's TSX. If you don't happen to have react, preact or a similar front end library, and a appropriate bundler, it is invalid TypeScript. > That looks like HTML, but it's TypeScript. It gets compiled to actual HTML. Can any Python framework do that?? IMHO that's a terrible idea that no one should ever actually use, but if you are really in love with that, you can have it: https://github.c…

> If you don't happen to have react, preact or a similar front end library, and a appropriate bundler, it is invalid TypeScript. Not true, you can compile it to HTML on the backend or even statically too. It's not a terrible idea; it's actually amazing. One of Typescript's best features. I do agree at first it seems icky (reminds me of Qt's MOC) but in practice it's fantastic. I recommend you try it before criticisin…

> It's not a terrible idea; it's actually amazing.

You got it wrong, the terrible idea is `pyxy-org/pyxy`

>> invalid TypeScript.

> If you don't happen to have react, preact or a similar front end library, and a appropriate bundler, it is invalid TypeScript.

> Not true, you can compile it to HTML on the backend or even statically too.

I had to test your assertion that it compiles to HTML. I remember it being very invalid typescript without react scafolding. So I tested it without the react scafolding:

    # mise use node@24
    # echo '{}' >package.json
    # npm i --save typescript
    # echo 'function Greeting({ name }: { name: string }) { return (  Hello, {name}! 

Welcome to my site.

); } ' >hello.tsx # : a test to check if we have a working typescript compiler # tsc hello.tsx error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error. # echo '{"compilerOptions":{"jsx":"react"}}' >tsconfig.json # tsc hello.tsx:1:58 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~~~~~~~~~~~~~~~~ hello.tsx:1:59 - error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~ hello.tsx:1:77 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~~ hello.tsx:1:78 - error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~ hello.tsx:1:95 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~~~ hello.tsx:1:101 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~ hello.tsx:1:102 - error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~ hello.tsx:1:123 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~~ hello.tsx:1:128 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. 1 function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); } ~~~~~~ Found 9 errors in the same file, starting at: hello.tsx:1 # cat hello.js function Greeting({ name }) { return (React.createElement("div", { class: "card" }, " ", React.createElement("h1", null, "Hello, ", name, "!"), " ", React.createElement("p", null, "Welcome to my site."), " ")); } # : sanity check # mise use deno # deno hello.tsx # : no output # echo 'function Greeting({ name }: { name: string }) { return ( Hello, {name}!

Welcome to my site.

); }; Greeting({ name: "world!" });' >hello2.tsx # deno hello2.tsx error: Uncaught (in promise) ReferenceError: React is not defined at Greeting (file:////hellotsx/hello.tsx:1:49) at file:////hellotsx/hello.tsx:1:141
Where is my static HTML? Oh, that requires react I guess.

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

#232

Earlier quoted context omitted.

"sweet spot for most things." care to expand on this a bit? Thanks.

Kotlin has the combination of JVM ecosystem, overall good performance and agents are good at writing it. I'd argue that it's a better default choice to reach for when working on non-frontend code than Go, though Rust and Python still have use cases.

Thanks, that makes sense. I agree.

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

#233

Earlier quoted context omitted.

Upvoted you, because the downvotes from the Python cult are unfair.

Haha thanks. Funny thing is, I’ve been a long time Python fan, learning it in 2001 and using it extensively for a long time. But then I learned Clojure, Typescript, and recently Rust and I’ve found Python to be quite flawed. But it sure does have a cult following.

:) I use Python as well-- so i am not anti-Pythonic in any strict sense. However, I don't like culltification of technology, be it Python or whatever else. Have you tried F#? It gave me a very good experience.

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

#234
post #207
post #163

Earlier quoted context omitted.

I don't think I will ever understand the culture of Go. The syntax of a very low level language (needlessly verbose), combined with the performance of a very high level language (needlessly slow), with a bizarre aversion to any DX conveniences (pattern matching, ORMs, etc). If you're already giving up all that performance, why would you not take the extra convenience? Not to mention that the demographic using Go - a…

It was a mix of who came up with it, and having hit jackpot with Docker and Kubernetes rewrites from Python and Java respectively, into Go. Had the rewrites not taken place, or Rust already being 1.0 by then, most likely would have had as many commercial success as Oberon and Limbo managed to. You see this happening nowadays newer CNCF projects tend to be done in Rust, and there are even some that even go the C++ way…

Good observations.

Judging by the community around Go, I also wonder if there's not an element of baby JS devs upskilling to Go, without yet having picked up a wider perspective. The performative aversion to DX could be explained if one sees Go as the opposite swing of the pendulum to JS and its excessive reliance on libraries, sugar, etc.

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

#235

Earlier quoted context omitted.

Haha thanks. Funny thing is, I’ve been a long time Python fan, learning it in 2001 and using it extensively for a long time. But then I learned Clojure, Typescript, and recently Rust and I’ve found Python to be quite flawed. But it sure does have a cult following.

:) I use Python as well-- so i am not anti-Pythonic in any strict sense. However, I don't like culltification of technology, be it Python or whatever else. Have you tried F#? It gave me a very good experience.

Only briefly for fun (and OCaml too but very long ago). F# does seem like a language I feel I could really like, though.

I’ve tinkered a little in Gleam and Elixir too. Elixir was incredibly enjoyable, and Gleam is a wonderful language that I wish I could work with more, but I don’t really have a use case for it and nobody will pay me to write it…

Back in 2009, I also spent a few months playing with Factor (before switching to Clojure because despite Clojure being niche, Factor was even more so). It was an interesting and somewhat mind bending experience.

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

#236

Earlier quoted context omitted.

There is little that they can do short of running the programs in a VM. Linux distros aren't engineered to consider applications as something different from the user running them. You need a completely different security model to achieve that and the Python runtime isn't tackle that.

In its inception 35 years ago the creator of python could not foresee how far python would go and how the environment would look like today. But nowadays there are a lot of security mechanisms they could leverage to adapt (from chroot by default to namespaces, cgroup, etc. on Linux, pledge, unveil on OpenBSD). The very idea that you offer a (python) package installer that is gonna pull a tree of code published and up…

The point is that nothing you are saying here has anything to do with Python or its design and would be equally true of any programming language with a comparable ecosystem.
Post reply on HN