Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Iterator Arguments Results
Iterator Arguments Results Example
============================ ============================ ================================================= =============================================================
:func:`accumulate` p [,func] p0, p0+p1, p0+p1+p2, ... ``accumulate([1,2,3,4,5]) → 1 3 6 10 15``
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=3) → ABC DEF G``
:func:`batched` p, n (p0, p1, ..., p_n-1), ... ``batched('ABCDEFG', n=2) → AB CD EF G``
:func:`chain` p, q, ... p0, p1, ... plast, q0, q1, ... ``chain('ABC', 'DEF') → A B C D E F``
:func:`chain.from_iterable` iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``
:func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) → A C E F``
Expand Down Expand Up @@ -181,7 +181,7 @@ loops that truncate the stream.
Roughly equivalent to::

def batched(iterable, n, *, strict=False):
# batched('ABCDEFG', 3) → ABC DEF G
# batched('ABCDEFG', 2) → AB CD EF G
if n < 1:
raise ValueError('n must be at least one')
iterator = iter(iterable)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_ast/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3545,7 +3545,7 @@ def test_show_empty_flag(self):
self.check_output(source, expect, '--show-empty')


class ASTOptimiziationTests(unittest.TestCase):
class ASTOptimizationTests(unittest.TestCase):
def wrap_expr(self, expr):
return ast.Module(body=[ast.Expr(value=expr)])

Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/stgdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ error:;

/*
Replace array elements at stginfo->ffi_type_pointer.elements.
Return -1 if error occured.
Return -1 if error occurred.
*/
int
_replace_array_elements(ctypes_state *st, PyObject *layout_fields,
Expand Down
2 changes: 1 addition & 1 deletion Modules/_interpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ _run_in_interpreter(PyThreadState *tstate, PyInterpreterState *interp,

// Prep and switch interpreters.
if (_PyXI_Enter(session, interp, shareables, &result) < 0) {
// If an error occured at this step, it means that interp
// If an error occurred at this step, it means that interp
// was not prepared and switched.
_PyXI_FreeSession(session);
_PyXI_FreeFailure(failure);
Expand Down
2 changes: 1 addition & 1 deletion Tools/peg_generator/pegen/parser_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def visit_NamedItem(self, item: NamedItem) -> None:


class KeywordCollectorVisitor(GrammarVisitor):
"""Visitor that collects all the keywods and soft keywords in the Grammar"""
"""Visitor that collects all the keywords and soft keywords in the Grammar"""

def __init__(self, gen: "ParserGenerator", keywords: Dict[str, int], soft_keywords: Set[str]):
self.generator = gen
Expand Down
Loading