Hacker News new | ask | show | jobs
by kstrauser 1033 days ago
Python’s type annotations carry the same information, but explicitly. If fetch_users() returns a list of users, you know exactly what “users” is and whether it can be None.

Really, though, list.empty() is canonically spelled “not list” in Python. That’s the idiom to learn, read, and write.