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

Recursion error with flatten and unicodes #73

Open
gabrielpjordao opened this issue Nov 18, 2014 · 1 comment
Open

Recursion error with flatten and unicodes #73

gabrielpjordao opened this issue Nov 18, 2014 · 1 comment

Comments

@gabrielpjordao
Copy link
Contributor

Hey, I get recursion errors on Python 2.7 while executing the following code:

list(flatten([ ['a', u'c'], ['a', 'b'] ]))

I think the issue is here (https://github.com/kachayev/fn.py/blob/master/fn/iters.py#L224), but as I couldn't take a deeper look at it yet, I'm just creating the issue to let you guys know.

@microamp
Copy link

Looks like the current implementation would only work in Python 3.

The unicode in u'c' is causing the issue in your case since unicode and str are two different things in Python 2. There is basestring from which both of these inherit, but using that would only work in Python 2 again.

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

No branches or pull requests

2 participants