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

Refactoring causing RecursionError #96

Closed
MarcoGorelli opened this issue Nov 4, 2020 · 6 comments
Closed

Refactoring causing RecursionError #96

MarcoGorelli opened this issue Nov 4, 2020 · 6 comments
Labels
bug Something isn't working next release This will be fixed in next release

Comments

@MarcoGorelli
Copy link

Hi,

I tried using Sourcery to refactor some of the pandas code, and it suggested a refactoring which caused a RecursionError:

-        for i in range(len(self)):
-            yield self[i]
+        yield from self

See pandas-dev/pandas#37581

Flagging this up in case it's useful to you

@Hellebore Hellebore added the bug Something isn't working label Nov 4, 2020
@Hellebore
Copy link
Collaborator

Thanks for raising! We'll take a look.

@MarcoGorelli
Copy link
Author

No worries! here's another refactoring which didn't work for us

@Hellebore
Copy link
Collaborator

No worries! here's another refactoring which didn't work for us

That's an interesting one - we rely on the typing to infer that it's a list so we can do that refactoring.

@MarcoGorelli
Copy link
Author

Ah OK, so in that one the refactoring brought up an incorrect type annotation...thanks!

@brendanator
Copy link
Collaborator

Thanks for the report. Fix identified and will be in the next release

@brendanator brendanator added the next release This will be fixed in next release label Nov 6, 2020
@Hellebore
Copy link
Collaborator

Resolved with release of 0.8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release This will be fixed in next release
Projects
None yet
Development

No branches or pull requests

3 participants