Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: