4 ms·
Ackchyually, Python has pretty strong typing, as far as dynamic languages go.
by folkrav 2y ago
Ackchyually, Python has pretty strong typing, as far as dynamic languages go.
- bhickey 2y agoSure. Everything is a PyObject.
- nas 2y agoEvery PyObject structure has a ob_type pointer.
- ackfoobar 2y agoEvery Object in Java has a getClass method. If we changed all the static type information in Java to the `Object` type, that'd be pretty close to Python's case. GP's post is probably the "unityped" critique of dynamically typed languages by Robert Harper: https://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ https://existentialtype.wordpress.com/2011/03/19/dynamic-lan...
- bhickey 2y agoThank you for sharing. I hadn't read that critique but I am in wholehearted agreement. Dynamic typing imposes significant cognitive overhead in exchange the privilege of letting you writing incorrect programs.
- Insanity 2y agoIf you use the actual type system and something like mypy, Python is a joy work with. (For my definition of joy, which includes static typing).
- IshKebab 2y agoActually writing Python is reasonably nice in that case. But dealing with Python infrastructure is so awful as to make the whole experience just bad. uv fixes a lot of that, but I think it will be some time before it's used everywhere, and I have zero hope that the Python devs will ever do the right thing and officially replace Pip with uv.
- arccy 2y agoyou also have to trawl through the flags to make sure it actually checks types, e.g. check_untyped_defs