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

Accept duck typed python streams. #185

Merged
merged 3 commits into from
Oct 20, 2020
Merged

Accept duck typed python streams. #185

merged 3 commits into from
Oct 20, 2020

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Oct 12, 2020

AWS CLI has a custom stream class with no base that only implements read()

  • Don't require python stream to inherit from io.IOBase
  • Accept python streams that only implement read() (previously required readinto()).
  • C callbacks now invoke private methods on python self, instead of public methods on other python stream. Easier to debug, and keeps complex logic out of C
  • Tweak docs to clarify "binary stream" and "HTTP stream"

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Previously, we required inheritence from io.IOBase. Also, accept streams that only implement read() (previously required readinto()).

AWS CLI has a custom stream class with no base that only implements read()
@lgtm-com
Copy link

lgtm-com bot commented Oct 12, 2020

This pull request introduces 1 alert when merging 5a4278a into ccc5ed1 - view on LGTM.com

new alerts:

  • 1 for Unused import

@graebm graebm merged commit 53d9cff into master Oct 20, 2020
@graebm graebm deleted the duck-streams branch October 20, 2020 16:43
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.

2 participants