3 ms·
How about a type error, which what actually happens? from pathlib import Path p = Path(".") print("some random string" + p) If you store typed dat
by acdha 9y ago
How about a type error, which what actually happens?
from pathlib import Path
p = Path(".")
print("some random string" + p)
If you store typed data as generic strings, of course, it’ll work but no language has an AI which will prevent you from being lazy about that.
- willtim 9y agoPerhaps filepath was a bad example for Python, as it has assertions. Zenhack actually made the same point and explained it better than me. Your runtime assertions (what you call "strong dynamic types") are a feature of the libraries you are using and a few built-in primitives. Python does not really have any facilities to talk about types. Using strings as in my example, would be "weak typing" in your terminology, but as you said, this is possible in any language, even Haskell. Therefore I fail to see how strong/weak is a language property. We are therefore left with static and "dynamic types", which Robert Harper argues should be statically typed and statically unityped.
- coldtea 9y ago>Therefore I fail to see how strong/weak is a language property. That much is a given...