0

There have been many questions and answers about the relative benefits of static and dynamic typing. Each has their camp, and there are obviously good reasons for both. I'm wondering though, are there any specific features of Python that wouldn't be possible to implement or use in a statically-typed language?

I would expect that some of the more functional parts would be challenging, but we obviously have Haskell and C++14 and onward.

Again, specific examples would be appreciated!

Jeremy
  • 104
  • 3
  • 12
  • No, pretty sure that there isn't a single element in python that couldn't be done with static typing. As you yourself point out, some things would be more challenging, but if they are useful they are also present in some static typed languages. – Tomasz Plaskota Jul 17 '17 at 14:04

1 Answers1

1

It is not possible to implement a list of heterogeneous types if you don't know all types you'll need at compile time. Example: you load with input() a user script that defines a new value of a new type defined there. Then you want to insert that value in a list in your program. I guess a lot of thing that come from interactions with input() are impossible to implement.

Contaso
  • 52
  • 6