Hacker News new | past | comments | ask | show | jobs | submit login

How do you work with so much python code with no type annotations? I get it for smaller projects but isn't half this stuff meant to be library code?



Some of this code is older, before I was more serious about this specific code, and moving to type annotations has been pretty much the big project of the year for me for everything personal, among other "Eliminate everything hacky" projects, going back into 10yo code and cleaning up tons of stuff.

My bigger priority has been moving from Mako to Jinja2, especially for some particularly horrid templates that could not be highlighted or formatted because there's not many good Mako tools, JSON schema validation, but I definitely agree type annotations are critical.

VS Code is smart enough to catch a lot of stuff sans annotations though, so you can get by with a lot of nonsense, especially when half your time is just fighting GStreamer and you're not paying as much attention to the python side.

There's nothing better than GST that I've ever seen for dealing with media without actually having to touch the performance critical stuff in your own code, but it is not easy to debug stuff buried in autogenerated python bindings to C code, especially with an extra RPC layer to use a background process and defend against segfaults.

There's also lots of other weird stuff, like imports not at the top of the file, meant to support systems where some module wasn't available, and generally all kinds of cleanup that's slowly happening.




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

Search: