top | item 44698136

(no title)

Jabrov | 7 months ago

The latest versions of Python 3 already have or can do most of these things.

discuss

order

echelon|7 months ago

They do not enforce it. It's not about "can do". It's about defaults and enforcing stricter standards.

Python is too flexible. It produces sloppy code.

And in no world are Python builds and dependencies solved. It's a major headache.

zahlman|7 months ago

> > runtime optionally type checked interfaces

> They do not enforce it. It's not about "can do". It's about defaults and enforcing stricter standards.

How exactly do you want to "enforce" an "optional" runtime type check for an interface, that is different from opting in by calling `isinstance`?

For that matter, `TypeError` exists and is raised non-optionally by all sorts of things.

> And in no world are Python builds and dependencies solved. It's a major headache.

For your specific set of dependencies, perhaps. Lots of people are using Python just fine. A large majority of what I'm interested in using would install fully (including transitive dependencies) from pre-built wheels on my system; and of those wheels, a large majority contain only Python code that doesn't actually require a build step. (Numpy is the odd one out here.)

In fact, of the top 10 largest packages in my system's `dist-packages` (all stuff that came provided with my Linux distro; I respect PEP 668 and don't let Python native packaging tools touch that environment), at least 9 have wheels on PyPI, and 4 of them have `none-any` wheels. (And of course, tons of the smaller ones are pure Python - there's simply no room for a compiled binary there.)

7bit|7 months ago

If you want Python to be like TypeScript, why don't you just write a typescript then?