GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-156233: Fixing a couple of typos and a few code snippet errors in Python docs by willy-b · Pull Request #156475 · python/cpython Conversation
|
| to the log). Nevertheless, the above should be adaptable to your speciric needs. With |
Nevertheless, the above should be adaptable to your speciric needs.
"speciric" should be "specific".
On https://docs.python.org/3.16/library/logging.config.html (archived as is at https://web.archive.org/web/20260827041728/https://docs.python.org/3.16/library/logging.config.html )
You can also specify a special key '.' whose value is a mapping of attribute names to values. If found, the specified attributes will be set on the user-defined object before it is returned. Thus, with the following configuration:
{ '()' : 'my.package.customFormatterFactory', 'bar' : 'baz', 'spam' : 99.9, 'answer' : 42, '.' { 'foo': 'bar', 'baz': 'bozz' } }
It seems the key "." is missing a ":" before its value to avoid ':' expected after dictionary key (<string>, line 6)' for the above.
cpython/Doc/library/logging.config.rst
Line 558 in fe3a26f
| '.' { |
On https://docs.python.org/3.16/library/pdb.html#pdbcommand-exceptions (archived as is at https://web.archive.org/web/20260827042203/https://docs.python.org/3.16/library/pdb.html#pdbcommand-exceptions )
nit: In the example
def out(): try: middle() except Exception as e: raise ValueError("reraise middle() error") from e def middle(): try: return inner(0) except Exception as e: raise ValueError("Middle fail") def inner(x): 1 / x out()
There is an extra space on the beginning of the last line out(), which prevents the snippet from running exactly as is if copy-pasted.
Line 837 in fe3a26f
| out() |
In the latest version of https://docs.python.org/3/howto/mro.html#python-2-3-mro (archived as is at https://web.archive.org/web/20260822145356/https://docs.python.org/3/howto/mro.html#python-2-3-mro )
In the sentence
Then repeat the operation until all the class are removed or it is impossible to find good heads.
it seems "all the class" should be "all the classes".
I am not trying in this PR to fix the non-default type parameter 'TypeVarWithBound' follows default type parameter for the overly_generic example on https://docs.python.org/3.16/reference/compound_stmts.html yet ( caused by
cpython/Doc/reference/compound_stmts.rst
Line 1852 in fe3a26f
| TypeVarWithDefault = int, |
Let me know if there are any additional backport PRs or other language repos for the docs I need to open manually to propagate these changes (if the automated backports don't end up running for this PR).
Thanks so much!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Documentation build overview
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I just noticed #156233 (comment), can you please fix it here as well. Indeed it's currently a def overly_generic[
SimpleTypeVar,
- TypeVarWithDefault = int,
TypeVarWithBound: int,
TypeVarWithConstraints: (str, bytes),
+ TypeVarWithDefault = int,
*SimpleTypeVarTuple = (int, float),
**SimpleParamSpec = (str, bytearray),
](
a: SimpleTypeVar,
- b: TypeVarWithDefault,
- c: TypeVarWithBound,
- d: Callable[SimpleParamSpec, TypeVarWithConstraints],
+ b: TypeVarWithBound,
+ c: TypeVarWithConstraints,
+ d: Callable[SimpleParamSpec, TypeVarWithDefault],
*e: SimpleTypeVarTuple,
): ... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@StanFromIreland have you tried your proposed fix with mypy ( https://github.com/python/mypy ) or any type checker that would use the type annotations? Note that I did NOT make any updates in this PR to that page or the cpython/Doc/reference/compound_stmts.rst Line 1852 in fe3a26f
Furthermore, when taking a look at how mypy is processing the kinds of type annotations in the All this makes me wary to bundle that one example in with a simple typo and syntax error fixup PR as there may be more updates needed to that section. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think it's fine to fix the SyntaxError in this PR, as I suggested. If we need further changes they can be done in a follow up, and in any case, it's outright broken currently anyway. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
OK, let's try to fix the prior author's To fix: how about we use cpython/Doc/reference/compound_stmts.rst Line 1856 in fe3a26f
And to avoid we can unpack the TypeVarTuple as cpython/Doc/reference/compound_stmts.rst Line 1855 in fe3a26f
unpack it also at cpython/Doc/reference/compound_stmts.rst Line 1862 in fe3a26f
With both those changes as well as moving Some related checks we can do in MyPy are: Thanks. If the above definition update I propose is OK, I will update the PR accordingly. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apparently the suggested follow-up is too complex. I'd be fine with leaving it to a follow-up PR, so we can merge this one.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sure, let's merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @willy-b for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @willy-b for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @willy-b for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-157221 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-157222 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-157223 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…56475) (#157221) (cherry picked from commit 9f90a86) Co-authored-by: Willy Bruns <[email protected]>
…56475) (#157222) (cherry picked from commit 9f90a86) Co-authored-by: Willy Bruns <[email protected]>
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* main: (158 commits) pythongh-156924: Try reifying lazy imports in `ForwarRef.evaluate()` (python#156940) pythongh-156233: Fix typos and code snippet errors in the docs (python#156475) pythongh-156837: Refer to yield expressions in generator function definitions (pythonGH-156863) pythongh-155292: Skip updating unicodedata with mismatched interpreter (pythonGH-157066) pythongh-157170: Document the scope of global curses settings (pythonGH-157207) pythongh-155966: Correct handling of `math.tanpi` poles (python#155980) pythongh-157170: Restore use_env() after test_use_prescr_screen in test_curses (pythonGH-157171) pythongh-156910: fix deadlock in type_set_abstractmethods under free-threading (python#156948) pythongh-155648: Write the empty and placeholder IDLE tests (python#156260) pythongh-153569: centralize formatted-string state and source spans (python#156484) pythongh-157137: Mark the PEP 820 soft deprecations as 3.15, not `next` (python#157138) pythongh-152433: Use regular LoadLibrary in UWP for Windows system libs (pythonGH-156972) pythongh-121617: Fix Py_CLEAR() memcpy in C++: replace NULL with _Py_NULL (python#157188) pythongh-157135: Fix documentation errors in the `math.atan{2}pi` functions (python#157136) pythongh-121617: Fix Py_CLEAR() in C++: replace NULL with _Py_NULL (python#157067) pythongh-156774: Speed up pdb startup with asyncio guard (python#156775) pythongh-156109: Allow static, non-framework iOS builds (python#156110) pythongh-156780: Emscripten: add missing EM_JS_DEPS (python#156798) pythongh-152936: Make privileged functions available on Android (python#152977) pythongh-123018: Keep the libedit history file header when truncating (pythonGH-157165) ...
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.