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

List contractions with multiple for statements and comma separation don't work #41

Open
kayhayen opened this issue Nov 28, 2014 · 7 comments

Comments

@kayhayen
Copy link

Hello,

this crashes RedBaron:

[1
for d in e, f
for g in h
]

Removing the ",f" seems to make it work as do braces around "e, f", but they
are not required by the language.

Enjoy the riddle,
Kay

@Psycojoker
Copy link
Member

Confirmed, this one is a RedBaron specific bug, not a Baron bug.

@kayhayen
Copy link
Author

kayhayen commented Dec 8, 2015

Hello,

installing redbaron from PyPI the released version doesn't cover previous fixes, I think I did test installations before. It seems as if redbaron is no longer actively maintained. Can you confirm this, and if it's the case, recommend a replacement.

Yours,
Kay

@kayhayen
Copy link
Author

kayhayen commented Dec 8, 2015

Ah, I just raised an issue, and was not aware that the tiny change would cause it. Seems released version is still good enough me. However this issue and others still exist. I am curious if development has a chance to continue.

@Psycojoker
Copy link
Member

Hello,

In regard of development, it's still more or less there but it's very far away from the level I had previously for two reason:

  • life events pushed me away from it (read: quite very hard burnout) and my life didn't waited for me to restore from filling itself
  • I'm blocked on an advanced refactoring of the internal behavior of the merging algorithm of the proxy list. It's hard, ungrateful and I need to find both motivation and time to pass the last broken tests (which are especially boring and hard) and once it's done, my plan is to move in direction of a 1.0 (there is still quite a lot of work for that) which will include fixing bugs like this one.

But the project is not abandoned and I've actually found someone to help me on the theoretical research part of it.

You can follow my work here if you are curious https://github.com/Psycojoker/redbaron/tree/refactor_proxy_list_algo

@ibizaman
Copy link
Collaborator

Note that that syntax is only valid in python2:

img-2016-12-23-221520

img-2016-12-23-221556

Using surround parenthesis works for all versions:

[1 for d in (e, f) for g in h]

I'll of course still provide a fix though.

@ibizaman
Copy link
Collaborator

ibizaman commented Dec 24, 2016

Wow, even weirder, the parenthesis-less syntax does not work in python2 with generators and set comprehensions:

img-2016-12-23-225814

img-2016-12-23-230144

@ibizaman
Copy link
Collaborator

Looks like it's a baron bug in fact, see PyCQA/baron#94

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

3 participants