re Challenge: More Compact?

Roy Smith roy at panix.com
Mon Jul 16 07:43:51 EDT 2001


quinn at regurgitate.ugcs.caltech.edu (Quinn Dunkan) wrote:
> for o in '.'.split(ip_addr):
>     assert 0 <= int(o) <= 255, 'ip octet not a byte in "%s"' % ip_addr

Don't you also have to catch the ValueError you'll get if o is not a valid 
integer?



More information about the Python-list mailing list