arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
484 stars 203 forks source link

Add PEP 593 based types for all modules for cleaner usage #425

Open JensHeinrich opened 6 months ago

JensHeinrich commented 6 months ago

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

arthurdejong commented 3 months ago

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?

JensHeinrich commented 3 months ago

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+