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

Conversation

felixfontein
Copy link
Contributor

Fixes #3080.

@felixfontein felixfontein requested a review from Kwpolska May 9, 2018 19:17
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But strings do have iter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops. That was stupid :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that...

Copy link
Member

@ralsina ralsina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually equivalent?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. I changed it.

@Kwpolska Kwpolska merged commit 960af8f into master May 9, 2018
@Kwpolska Kwpolska deleted the improve-smartjoin branch May 9, 2018 19:55
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.

None yet

3 participants