Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use explicit signature in pyplot.close() #11563

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

Merged
merged 1 commit into from
Jul 4, 2018

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jul 3, 2018

PR Summary

Use explicit argument in pyplot.close() instead of *args. The signature gets more explicit and the code gets shorter.

The behavior of the code stays exactly the same (apart from a different message in the TypeError if more than one parameter is passed).

@timhoffm timhoffm changed the title Update pyplot.close docstring Use explicit signature in pyplot.close() Jul 3, 2018
"""

if len(args) == 0:
if fig is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

... is None?

@timhoffm timhoffm force-pushed the doc-pyplot-close branch from e782b23 to 31f4471 Compare July 3, 2018 23:15
else:
raise TypeError('close takes 0 or 1 arguments')
raise TypeError('Unrecognized argument type %s to close' % type(fig))
Copy link
Contributor

Choose a reason for hiding this comment

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

argument of type
or see how e.g. int does it:

----> 1 int([])

TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

@timhoffm timhoffm force-pushed the doc-pyplot-close branch from 31f4471 to f6bdcb5 Compare July 3, 2018 23:25
@tacaswell tacaswell added this to the v3.0 milestone Jul 4, 2018
@tacaswell
Copy link
Member

👍 , but I am concerned about the drop in the coverage on the tests. Historically that has not had many false-positives.

@timhoffm
Copy link
Member Author

timhoffm commented Jul 4, 2018

I don't really understand how codecov generates its numbers. Out of the two branches, two are not hit: the UUID und the TypeError. The coverage for pyplot has actually increased. For some reason there are other changes as well in the codecov report, which are not part of the PR.

@jklymak jklymak merged commit 38fd2ea into matplotlib:master Jul 4, 2018
@timhoffm timhoffm deleted the doc-pyplot-close branch July 5, 2018 05:29
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.