seandstewart / typical

Typical: Fast, simple, & correct data-validation using Python 3 typing.
https://python-typical.org
MIT License
182 stars 9 forks source link

Casting Strings with Whitespace to NetworkAddress Causes an Error #135

Closed seandstewart closed 3 years ago

seandstewart commented 3 years ago

Description

Casting to a NetworkAddress should automatically strip whitespace before validation.

Expected Behavior


import typic

string = "http://foo.bar "
url = typic.URL(string)
print(repr(url))
#> 'http://foo.bar'