HackerTrans
TopNewTrendsCommentsPastAskShowJobs

clepto

no profile record

comments

clepto
·2 ปีที่แล้ว·discuss
I see a lot of people mentioning Pydantic here, but you should take a look into TypedDict. It provides a type structure ontop of a plain dictionary, and sounds like exactly what you’d want, and is a built-in that you don’t need a dependency for.

Mypy for example can also see the types of the dictionary are supposed to be when you use it just like a normal dictionary.
clepto
·2 ปีที่แล้ว·discuss
I once had a VPN utility that HAD to be closed with a Keyboard Interrupt in order for it to shut-off properly, so my systemd setup for it didn’t work. I ended up making bash aliases for tmux commands to run it and send the keyboard interrupt signal into it to stop it. I’m sure there was a way to do this with systemd, but tmux was easy, if a bit jank.