4 ms·
> In python nothing can guarantee at compile time that you are not passing a username variable in a method that accepts an email address Is there no reason you
by cabalamat 10y ago
> In python nothing can guarantee at compile time that you are not passing a username variable in a method that accepts an email address
Is there no reason you could not create an Email class and have the method require its argument to be of that type?
- minitech 10y ago> guarantee at compile time If you’re talking about runtime type checks rather than mypy, well, they’re just verbose static types with less safety. (May as well just embrace the duck typing at that point by accessing email.local_part and letting the AttributeError propagate.)