r/programming • • Jun 27 '18

Python 3.7.0 released

https://www.python.org/downloads/release/python-370/
2.0k Upvotes

383 comments sorted by

View all comments

340

u/[deleted] Jun 28 '18

I'm glad for the improvements to typing and the new data classes. Here's hoping that the recent push for optional static checking will prove helpful to those building larger apps using Python.

-61

u/leftofzen Jun 28 '18

To me, a non-Python user, this whole type checking this is hilarious and farcical. Python is made with dynamic typing as a feature and it's lack of type checking (at least until run time) is one of it's strengths. To now start static type checking - why even bother; you may as well use a real language with first class static typing support. Bolting it on as an after thought still makes me laugh hehe.

1

u/Homoerotic_Theocracy Jun 28 '18

Everything Python is is "stuff bolted onto it after the fact"; in that sense it's quite the dynamic C++ and guess what C++ also now has support for dynamic typing.

0

u/[deleted] Jun 28 '18

[deleted]

13

u/Homoerotic_Theocracy Jun 28 '18

And I'm not talking about "auto"; I'm talking about std::any where a datum is stored together with a type tag in a fat pointer that preserves the type information at runtime which can be queried.

10

u/ThePantsThief Jun 28 '18

It's a box class, not a language feature. That's even more "bolted on" than python's static typing.

7

u/Homoerotic_Theocracy Jun 28 '18

Yeah it turns out you can simulate dynamic typing in static typing in terms of just making every expression the same type to some kind of struct which stores the type info in a field.

That's pretty much what all those implementations that compile a dynamic language to C do; they define something like a struct called SchemeObj and have a field for the type tag and pass that around everywhere.

→ More replies (2)