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

Improving smartjoin for non-strings (#3080) #3086

Merged
merged 3 commits into from May 9, 2018
Merged

Improving smartjoin for non-strings (#3080) #3086

merged 3 commits into from May 9, 2018

Conversation

@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented May 9, 2018

Fixes #3080.

@felixfontein felixfontein requested a review from Kwpolska May 9, 2018
nikola/utils.py Outdated
"""
if isinstance(string_or_iterable, (unicode_str, bytes_str)):
return string_or_iterable
if hasattr(string_or_iterable, '__iter__'):
Copy link
Member

@ralsina ralsina May 9, 2018

But strings do have iter

Copy link
Contributor Author

@felixfontein felixfontein May 9, 2018

Ooops. That was stupid :)

Copy link
Contributor Author

@felixfontein felixfontein May 9, 2018

Fixed that...

@felixfontein felixfontein force-pushed the improve-smartjoin branch from 5b7e800 to 9eccdbf May 9, 2018
ralsina
ralsina approved these changes May 9, 2018
Copy link
Member

@ralsina ralsina left a comment

LGTM

nikola/utils.py Outdated
"""
if isinstance(string_or_iterable, (unicode_str, bytes_str)):
return string_or_iterable
elif hasattr(string_or_iterable, '__iter__'):
Copy link
Member

@Kwpolska Kwpolska May 9, 2018

isinstance(string_or_iterable, collections.Iterable) would look nicer IMO

Copy link
Contributor Author

@felixfontein felixfontein May 9, 2018

Is this actually equivalent?

Copy link
Member

@Kwpolska Kwpolska May 9, 2018

yes

Copy link
Contributor Author

@felixfontein felixfontein May 9, 2018

Good to know. I changed it.

@Kwpolska Kwpolska merged commit 960af8f into master May 9, 2018
0 of 5 checks passed
@Kwpolska Kwpolska deleted the improve-smartjoin branch May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants