-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is_point #9
Comments
No, it isn't because it will not return false if Python programmers usually write This will check if p is an iterable of numbers or numeric strings elements with length 2:
The slicing in p[:4] is to avoid checking if all members of p are numeric if p is larger than 3. |
what about def is_point(p):
try:
return len(p)==2
except (TypeError, IndexError):
return False |
Previous suggestion was checking:
|
I'm going to keep it as it is until we get tests working I think: def is_point(p):
try:
return len([float(i) for i in p[:4]]) == 2
except (TypeError, IndexError):
return False looks good, but i really want test coverage to make sure. |
@scardine your function
is not equivalent to
The text was updated successfully, but these errors were encountered: