Skip to content
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

Fixed Issue #27. #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fixed Issue #27. #28

wants to merge 2 commits into from

Conversation

rtruxal
Copy link
Contributor

@rtruxal rtruxal commented Sep 6, 2017

Also added some explicit declarations including: explicit default val for json_result & a py3-compat issue involving rawstrings for use in regular expressions.

…uding: explicit default val for `json_result` & a py3-compat rawstring error.
Fix 1: Replaced the PyMsCognitiveSearch() arg ==> custom_params={} to custom_params=None + an if/else check. Reasoning: Dicts are mutable and default argument values are evaluated only once at function definition time, which means that modifying the default value of the argument will affect all subsequent calls of the __init__ function for PyMsCognitiveSearch(). See: https://docs.python.org/3.4/tutorial/controlflow.html#default-argument-values & scroll down to `IMPORTANT WARNING:`
Fix 2: python3 compatibility. raw_input doesn't exist in python3. Added a lil baby `from sys import version_info` + if/else gate to avoid syntax errors in python3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant