Hi,<br>Suppose you have a function to validate local/international phone numbers (one space between number groups, no space at start/end, no zero at start) like:<br><br><font face="tahoma, sans-serif">def validatePhone(v):<br>
if not (9 < len(v) < 19 and '0' < v[0]): <b># recall ' ' < '0'</b><br> return False<br><br> for c in v:<br> if '0' <= c <= '9':<br> wasspace = False<br>
else:<br> if c != ' ' or wasspace:<br> return False<br> wasspace = True<br><br> if wasspace:<br> return False # last one<br> return True</font><div><br></div>
<div>Just out of curiosity, would JITability of this function change if I put "wasspace = False" just before the loop ?</div><div><br></div><div>Note: attaching just in case indentation is lost when sending..</div>