<div dir="ltr"><div><div>Hi,<br><br><br></div>I'm writing a custom AMP type. I noticed that when writing the unit test for garbage input, I didn't really know what exception to check for.<br><br></div>I couldn't find any place where this was formally defined, so I checked for implementation behavior. Boolean explicitly raises TypeError. Integer raises ValueError, but that appears to only be an implementation detail of int.<br>
<br>It could also be that it doesn't matter at all, but it does seem a little strange that Integer and Boolean raise different exceptions when fed garbage...<br><div><div><div><div><br>-- <br>cheers<div>lvh</div>
</div></div></div></div></div>