python-stdnum icon indicating copy to clipboard operation
python-stdnum copied to clipboard

Add PEP 593 based types for all modules for cleaner usage

Open JensHeinrich opened this issue 1 year ago • 2 comments

PEP 593 creates an easily extendable syntax to annotate type with further information and annotated-types provides a rather easy interface with its Predicate

So adding a line like

Handelsregisternummer = Annotated[str, Predicate(is_valid)]

to the modules seems to be an useful expansion of this packages capabilities

JensHeinrich avatar Dec 12 '23 09:12 JensHeinrich

A problem with this is that the module currently still supports Python 2.7 (most of it should also still work with Python 2.6). In which Python version is this included?

arthurdejong avatar Mar 17 '24 13:03 arthurdejong

A problem with this is that the module currently still supports Python 2.7 (most of it should also still work with Python 2.6). In which Python version is this included?

If i see it correctly, it 3.8+

JensHeinrich avatar Mar 18 '24 07:03 JensHeinrich