FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

update SimpleHTTPRequestHandler by ethanfurman · Pull Request #9452 · python/typeshed · GitHub

update SimpleHTTPRequestHandler - #9452

Merged
AlexWaygood merged 2 commits into
python:mainfrom
ethanfurman:http
Jan 3, 2023
Merged

update SimpleHTTPRequestHandler#9452
AlexWaygood merged 2 commits into
python:mainfrom
ethanfurman:http

Conversation

Copy link
Copy Markdown
Member

The index_pages parameter has been removed from __init__ as subclassing is the encouraged method for modifying SimpleHttpRequestHandler.

index_pages should be a tuple of 0 or more strings (not sure I have the type hint correct).

This comment has been minimized.

AlexWaygood commented Jan 3, 2023
edited
Loading

Copy link
Copy Markdown
Member

The index_pages parameter has been removed from __init__ as subclassing is the encouraged method for modifying SimpleHttpRequestHandler.

But the parameter does nonetheless exist on the CPython main branch, no? :) https://github.com/python/cpython/blob/64ed609c532a12b27f67a1e12e9e02f136ee3a94/Lib/http/server.py#L664

We tend to be descriptive rather than prescriptive in typeshed. If a parameter exists at runtime, we tend to include it in the stub, even if it's not considered great style to use that parameter at runtime. If we do otherwise, people tend to complain loudly at us. It also means we have to switch off some of our tests that check that the stub is consistent with the runtime, and switching off those tests means our stubs become vulnerable to silently growing out of date without us noticing.

(You don't see those tests failing on this PR because we haven't switched them on yet for 3.12, since 3.12 is still in development.)

Copy link
Copy Markdown
Member Author

PR changing __init__ has now been merged. :-)

Copy link
Copy Markdown
Member

PR changing __init__ has now been merged. :-)

Ah! I didn't realise there was a pending PR :)

Copy link
Copy Markdown
Member

Maybe we're being a bit early with the 3.12 features here :) We can make this change though now that main has been changed.

Comment thread stdlib/http/server.pyi Outdated
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

github-actions Bot commented Jan 3, 2023

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

AlexWaygood merged commit 3aceb1a into python:main Jan 3, 2023
ethanfurman deleted the http branch January 4, 2023 00:03
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL