Re:Static types in Python
by orf on Friday October 14, 2016 @06:41AM
(#12707207)
You could make a property in Python that validates it's given value and throws a ValueError if it's not an email. 6 lines of code max, with maybe two tests.
[ Parent
| on HN ]
Re:Static types in Python
by tigershark on Friday October 14, 2016 @10:48AM
(#12708416)
How can this prevent you at compile time to pass a username instead of an email?