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

Finish implementing unpythonic.fix.fix #15

Closed
Technologicat opened this issue Aug 8, 2019 · 4 comments
Closed

Finish implementing unpythonic.fix.fix #15

Technologicat opened this issue Aug 8, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Technologicat
Copy link
Owner

Technologicat commented Aug 8, 2019

A.k.a. the function that detects and breaks recursion cycles. Related to Haskell's fix, but not the same thing.

Minimal TODO for a release-worthy version:

  • DONE: Allow kwargs for f, everything else does.
  • DONE: Make the implementation thread-safe, almost everything else is.
  • DONE: Move unit tests to a new separate module unpythonic/test/test_fix.py.
  • Investigate (but not necessarily resolve yet) whether we can reorganize things so we could guarantee to call bottom at most once. (Currently it's at least once, at most twice.)
  • Document it in README, including credits for the original idea (Matthew Might) and initial Python implementation (Per Vognsen).
@Technologicat Technologicat added the enhancement New feature or request label Aug 8, 2019
@Technologicat Technologicat added this to the 0.14.2 milestone Aug 8, 2019
@Technologicat Technologicat self-assigned this Aug 8, 2019
@Technologicat
Copy link
Owner Author

Unit tests moved in 09e1b5f. Thread-safety added in 3edb835.

@Technologicat
Copy link
Owner Author

Oops, didn't mean to close yet. Kwargs support added in 470a06b.

So the last thing for this issue, for now, is to write documentation for the README.

@Technologicat
Copy link
Owner Author

Technologicat commented Aug 21, 2019

  • DONE in 9ddd466: Fix the docstring, it currently says fix is not thread-safe, which is no longer true.
  • DONE in 8bb8fd9 (though only visited needed it): Unwind-protect the changes to visited and cache by using a finally block. Currently, if f raises, garbage is left in the state.

@Technologicat
Copy link
Owner Author

Since this is now just waiting for a README update, which is tracked in #8, this separate issue is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant