271
submitted 3 weeks ago by neme@lemm.ee to c/python@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] legion02@lemmy.world 15 points 3 weeks ago* (last edited 3 weeks ago)

They ignore types all together because typing is optional in python.

[-] bjornsno@lemm.ee 13 points 3 weeks ago

All documentation is optional and ignored at runtime, that doesn't mean you shouldn't do it. If your library doesn't have type hints I'm just not gonna use it, I don't have the time to figure out what you accept or return.

[-] legion02@lemmy.world -2 points 3 weeks ago

It means they have the option to do it or not do it and you have the option to not use it, which clearly your exercising. I've personally never had a situation where a lack of type hints slowed me down even a little.

[-] FizzyOrange@programming.dev 6 points 3 weeks ago

I dunno if you're being deliberately obtuse, but just in case you really did miss his point: the fact that type hints are optional (and not especially popular) means many libraries don't have them. It's much more painful to use a library without type hints because you lose all of their many benefits.

This obviously isn't a problem in languages that require static types (Go, Rust, Java, etc..) and it isn't a problem with Typescript because static types are far more popular in JavaScript/Typescript land so it's fairly rare to run into a library that doesn't have them.

And yeah you can just not use the library at all but that's just ignoring the problem.

True, but if you're looking at a Python library that doesn't have type hints in 2024, then chances are that it's not very good and/or not very well maintained.

[-] FizzyOrange@programming.dev 1 points 3 weeks ago

Well, indeed. Unfortunately there are still a fair number of them. The situation is definitely improving at least.

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
this post was submitted on 02 Nov 2024
271 points (98.2% liked)

Python

6400 readers
12 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS