stream: fix signatures of Stream classes & methods #5429
Merged
Conversation
- Revert `keywords` arg added to `HLSStream.parse_variant_playlist()` in d314c5b - Filter all variable keyword arguments before making any HTTP session calls or storing the request args dict - Make variable keyword arguments of all common public Stream methods consistent by renaming them to "kwargs"
Rename `session_` to `session`
8 tasks
gravyboat
approved these changes
Jul 9, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two commits:
A correction of d314c5b which shouldn't go into a stable release like this. The parameter removal is not a breaking change since it was only added to
masterso far.Any keywords arguments now get passed to
HLSStreamandMuxedHLSStreamusing the already existing variable keyword arguments (**kwargs) which then get filtered when making HTTP session calls.This also cleans up the API documentation a bit by having consistent names.
A "light" breaking change:
The
session_argument was named that way during the Livestreamer project becausesessionwas supposed to be included in the variable keyword arguments (**kwargs) because of (an old version of)requests(see 0308347 and 39008e9).Positional-only / keyword-only arguments have only become available with the drop of py37, so technically, all these classes/methods could've been called/initialized using the
session_keyword instead of just setting a positional argument, but that's very unlikely for 3rd party implementors to do that. I've decided against defining the arguments as positional-only / keyword-only now, because it's not really important.I'm going to add the name change to the list of breaking changes, even though it's a really minor change and basically just a fix for something annoying that should've been changed a long time ago.
release: 6.0.0 tracking issue #5401