Skip to content

fix: Make regen less greedy - #6542

Closed
maybe-sybr wants to merge 1 commit into
masterfrom
fix/regen-concretisation
Closed

maybe-sybr wants to merge 1 commit into
masterfrom
fix/regen-concretisation

Conversation

@maybe-sybr

@maybe-sybr maybe-sybr commented Dec 13, 2020 •

Copy link
Copy Markdown
Contributor

Description

This change is pulled from #3043 (and was also included in modified form in #4459 and #6112). It is the body of change to the functional.regen util which is sometimes greedy and also sometimes lost items per the issue reported in #4298.

This change fixes #4298 and we'll need to revisit the diffs from the other tagged PRs if we intend to address #3021.

Fixes #4298

Co-authored-by: Chad Dombrova <[email protected]>
@maybe-sybr

Copy link
Copy Markdown
Contributor Author

I've pulled and uplifted the tests added for regen in the original PR (#3043), but will need to check coverage prior to merge.

@maybe-sybr

Copy link
Copy Markdown
Contributor Author

@auvipy - I know #4459 was from quite a long time ago but I'd appreciate a review from you since you've seen these PRs before :)

@maybe-sybr
maybe-sybr requested a review from auvipy December 13, 2020 22:43
@maybe-sybr

Copy link
Copy Markdown
Contributor Author

Huh, where did Travis go in the checks? @thedrow any ideas?

@thedrow

thedrow commented Dec 13, 2020

Copy link
Copy Markdown
Contributor

Travis no longer works since we're out of credit.


def __iter__(self):
return chain(self.__consumed, self.__it)
for x in self.__consumed:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yield from is shorter...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, I'll change this and have a more critical read through for other 2.7isms which could be removed from this diff.

@lgtm-com

lgtm-com Bot commented Dec 13, 2020

Copy link
Copy Markdown

This pull request fixes 1 alert when merging 9f9c899 into 8bceb44 - view on LGTM.com

fixed alerts:

  • 1 for Module is imported with 'import' and 'import from'

else:
return True

# Python3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this block needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think not, we should just rename the __nonzero__() definition above to __bool__() now that we don't need to worry about 2.7. Good pick up.

@maybe-sybr

maybe-sybr commented Jan 12, 2021 •

Copy link
Copy Markdown
Contributor Author

Closing in favour of #6589 which landed earlier

@maybe-sybr maybe-sybr closed this Jan 12, 2021
@maybe-sybr
maybe-sybr deleted the fix/regen-concretisation branch January 12, 2021 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

group.skew() removes all tasks if group input is generator

3 participants