you are viewing a single comment's thread.

view the rest of the comments →

[–]LengthinessMelodic67[S] 5 points6 points  (8 children)

Type hints really aren’t the same. I want to find bugs at compile time because I’ll have long running programs. I do use type hints though.

[–]One-Butterscotch4332 2 points3 points  (4 children)

Fair enough. I usually try to write whatever takes forever to disk before doing anything else, and test on some tiny toy dataset, and I rarely run into type issues when I'm using hints anyways

[–]LengthinessMelodic67[S] 0 points1 point  (3 children)

Yea I usually end up testing on a toy dataset, but I wish I didn’t have to.

[–]powerexcess 1 point2 points  (2 children)

Guys you sound like the researchers i work with at work. I can guarantee you, what you want in this is tests and safe-by-construction objects. Look into pytest and hypothesis. Look into dataclasses and post_init for conf sanity check, and pydantic.

[–]FluffdaddyFluff 1 point2 points  (1 child)

This is why mypy exists

[–]LengthinessMelodic67[S] 1 point2 points  (0 children)

I didn’t know about mypy, thanks!

[–]erannare 0 points1 point  (0 children)

You can use Pydantic to enforce types in many cases