Add a missing raise in kdeplot and slightly improve lmplot signature #3602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed these while working on the stubs at typeshed. They felt small enough to include in a single PR.
raise
beforeTypeError(msg)
inkdeplot
data
parameter oflmplot
is required but it has a default ofNone
. 20 lines later there is a check that raises aTypeError
ifdata is None
. Removing the default makes sense here to signal to the user that they must pass this argument. It also has two more advantages. The first is that your IDE will now helpfully yell at you if you don't pass the argument. The second is minor but it will allow us to keep running the stub tests for this function at typeshed where we removed the default which made the stub go out of sync with the runtime implementation so we had to skip its tests to pass CI. Note that there is no user facing change here as calling the function without passingdata
still raises aTypeError
with a clear message.