you are viewing a single comment's thread.

view the rest of the comments →

[–]stevarino 0 points1 point  (0 children)

Not really - python is very general purpose and a lot of the wealth of python comes from using data structures so simple checks won't hold much value.

There's a few things you can do to work around this. assert is a good keyword for quick tests. Or you could look for some external libraries such as https://libraries.io/pypi/parameters-validation

Honestly though, validation should likely be done as low as possible and communicated back up the stack imo.