-
Notifications
You must be signed in to change notification settings - Fork 772
[DEVX-5006] Add input parameter to 'gather' and coerce language format. #353
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
Conversation
hints=hints, | ||
barge_in=barge_in, | ||
acknowledge_sound_url=acknowledge_sound_url, | ||
input=input, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input is a builtin function, so this might cause some trouble. Did these tests pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They did. While it's a built-in function, it's not reserved like "from". One could argue that there's potential that overwriting the value of input in this scope could cause errors; but, I seriously doubt it would. Happy to change it to "input_" if that's a preferred strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this alone will be fine in practice thanks to scoping.
twilio/twiml/__init__.py
Outdated
if not language: | ||
return language | ||
|
||
if not re.match('^\w\w[_-]\w\w$', language): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\w
matches words. It seems like we might want to match letters here? Like with [a-z]
or [A-Z]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. Since we're not validating that the string is an actual language specifier that's supported, we'd still be relying on the API to respond with an error if someone input something that was slightly wrong. The regex was mostly there to check that things look mostly right. Accepting digits and underscores didn't seem to be too far removed from the goal of just being a bit helpful.
hints=hints, | ||
barge_in=barge_in, | ||
acknowledge_sound_url=acknowledge_sound_url, | ||
input=input, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this alone will be fine in practice thanks to scoping.
No description provided.