is it possible to (in vs code, if that matters) make python warn you if you forget to return the specified type? returning None breaks stuff. i've made it throw an exception but i feel like there is a more elegant solution
Conversation
Notices
-
Embed this notice
lily ?️⚧️ (tauon@possum.city)'s status on Saturday, 05-Apr-2025 22:01:20 JST lily ?️⚧️
-
Embed this notice
Jesse 🇫🇷 (jessew@mk.cpluspatch.com)'s status on Saturday, 05-Apr-2025 22:01:16 JST Jesse 🇫🇷
@tauon@possum.city yeah absolutely
install the Pylint and Pylance extensions (one of them does the type checks and one of them does linting, i forgot which does which) -
Embed this notice
Jesse 🇫🇷 (jessew@mk.cpluspatch.com)'s status on Saturday, 05-Apr-2025 22:02:33 JST Jesse 🇫🇷
@tauon@possum.city python doesn't have static type checking built-in, that's the job of external programs like the aforementioned
if you just use static types without a type checker, they have zero use since Python itself will not check them (it just completely ignores all type declarations at runtime, like with TypeScript) -
Embed this notice
Jesse 🇫🇷 (jessew@mk.cpluspatch.com)'s status on Saturday, 05-Apr-2025 22:03:13 JST Jesse 🇫🇷
@tauon@possum.city or are you already doing that and mean something else entirely
-
Embed this notice