Skip to content

Conversation

@Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented Oct 24, 2019

Lib/functools.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

NIt: Please use single quotes, the same as used by dict.__repr__()

Copy link
Contributor

Choose a reason for hiding this comment

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

Also move the function to just after cache_clear().

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the decorator notation to create the example. Also, make the example use maxsize=1000 and typed=True.

Copy link
Contributor

Choose a reason for hiding this comment

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

``Add new cache_parameters() method for functools.lru_cache() to better support pickling.

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to test whether cache_parameters is NULL.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are also two possible failure points that need to be tested here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Drop the test for zero, putting the positive case first: self->typed ? Py_True : Py_False)
  2. Test the result of PyDict_SetItemString() to see if it failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Move this down one, just after the cache_clear entry.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Zheaoli Zheaoli force-pushed the bpo-38565 branch 2 times, most recently from 8354f2d to 37f4f0d Compare October 30, 2019 17:11
@Zheaoli
Copy link
Contributor Author

Zheaoli commented Oct 30, 2019

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@rhettinger: please review the changes made to this pull request.

@Zheaoli
Copy link
Contributor Author

Zheaoli commented Nov 9, 2019

ping @rhettinger

@rhettinger rhettinger merged commit 051ff52 into python:master Nov 12, 2019
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
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

Successfully merging this pull request may close these issues.

4 participants