Skip to content

listcomp -> for-loop (listcopms create a new scope in py3), bypass Attri... #11

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

Merged
merged 1 commit into from
Jan 30, 2014

Conversation

metakermit
Copy link
Contributor

...buteError on Pandas.str

Pushing pandas-dev/pandas#5530 upstream, so that the numpydoc version in Pandas can stay in sync.

@rkern
Copy link
Member

rkern commented Jan 30, 2014

👍

pv added a commit that referenced this pull request Jan 30, 2014
BUG: listcomp -> for-loop (listcopms create a new scope in py3), bypass AttributeError
@pv pv merged commit 945dcdf into numpy:master Jan 30, 2014
@pv
Copy link
Member

pv commented Jan 30, 2014

Thanks, merged.

@stefanv
Copy link
Contributor

stefanv commented Jan 30, 2014

As an educational exercise, would someone mind explaining this problem to me briefly?

@phaebz
Copy link

phaebz commented Jan 30, 2014

@stefanv This is a tricky issue with Python 3 class scope/namespace. I can point you to this and that SO question.

@stefanv
Copy link
Contributor

stefanv commented Jan 31, 2014

@phaebz Thanks for that. It looks like both these examples deal with class namespace vs scope, though?

@pv
Copy link
Member

pv commented Jan 31, 2014

I don't see issue in the list comprehension scoping as the iteration variable is not used afterward, but checking for the AttributeError is useful, and can't be done inside listcomp.

Py3 failure in the listcomp would have been caught by the test suite.

@stefanv
Copy link
Contributor

stefanv commented Jan 31, 2014

Thanks, @pv, that makes sense to me.

@phaebz
Copy link

phaebz commented Jan 31, 2014

I can't reproduce the error, please just forget what I said.

@jorisvandenbossche
Copy link
Contributor

There was a problem with pandas.Series.str returning an AttributeError, for which a fix (to return None) was applied at almost the same time as this fix was tried out. So probably the effect of both fixes were a bit mixed up.

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.

6 participants