metomi/isodatetime

Replace type checker function in Python 3.7

kinow opened this issue · 4 comments

kinow commented

When using Python 3.7, the _type_checker can go away and be replaced by type hints plus some checks for None.

Only issue with that is that the exception raised would change from BadInputError we would get TypeError I believe. But this way we wouldn't be duplicating something that can be done in the language (and actually, once type hinting was added to the project, parts of that function would never be used/covered in tests).

kinow commented

The same can be said about other type casting functions such as _int_caster. These may go too, unless they are indeed parsing values that were stored as strings, or parsed from a string.

Set to later - we may still have to support lower Python 3 versions.

@kinow is this closed by #123 ?

kinow commented

Not exactly, I think that was a failed attempt. Later realized it would still be safer to leave the runtime checks. Probably the easiest is to close it for now.