Skip to content

Fix return types in urllib.request #2389

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 3 commits into from
Sep 18, 2018
Merged

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Aug 16, 2018

  • Add missing methods to http.client.HTTPResponse
  • Tighten return types of URL handlers
  • urlopen() et al. return a modified HTTPResponse
  • Add missing arguments (not annotated) to HTTPErrorProcessor methods

@srittau
Copy link
Collaborator Author

srittau commented Aug 16, 2018

pytype fails for a reason I do not understand, although it also reports errors in unchanged files.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

I restarted the build; hopefully it will pass.

@JelleZijlstra
Copy link
Member

Hm, pytype is still not happy. :( @rchen152 could you take a look?

@rchen152
Copy link
Collaborator

Sorry, I missed this notification - happened to see this just now while browsing the PRs. Pytype is probably complaining about the # type: ignore - should be a simple enough thing to fix on the pytype end. I'll update once we've done so.

rchen152 added a commit to google/pytype that referenced this pull request Sep 18, 2018
For python/typeshed#2389.
I initially tried adding

constandef
 : constantdef typeignore
 ...

but that led to a shift/reduce conflict =(

PiperOrigin-RevId: 213505250
@rchen152
Copy link
Collaborator

Released pytype-2018.9.18 and reran the failing test - everything looks good now.

@rchen152 rchen152 merged commit 9827132 into python:master Sep 18, 2018
@JelleZijlstra
Copy link
Member

Thanks for fixing this!

@srittau srittau deleted the urlopen-return branch September 27, 2018 06:40
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
* Tighten return types of URL handlers

* urlopen() etc. return a modified HTTPResponse

* Add missing methods to HTTPResponse
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.

3 participants