Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0a4eabb
Add is_reading() method to _UnixReadPipeTransport
Nov 4, 2019
6552563
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (#17043)
commodo Nov 4, 2019
f7cd057
📜🤖 Added by blurb_it.
blurb-it[bot] Nov 4, 2019
f4b1e3d
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
vstinner Nov 4, 2019
4ef4d51
Update Misc/NEWS.d/next/Library/2019-11-04-17-20-43.bpo-38314.zWz6_P.rst
calluw Nov 4, 2019
be434dc
bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)
vstinner Nov 4, 2019
1726909
bpo-38644: Pass tstate to _Py_CheckFunctionResult() (GH-17050)
vstinner Nov 5, 2019
25fa3ec
Fix a typo in wave module docstring (GH-17009)
micha2718l Nov 5, 2019
62161ce
closes bpo-37633: Reëxport some function compatibility wrappers for m…
benjaminp Nov 5, 2019
fbbfcce
_json.c: use Py_UNUSED() macro (GH-17053)
vstinner Nov 5, 2019
5e01a65
Update interpreter.rst (GH-17059)
Seluj78 Nov 5, 2019
b396663
bpo-35381 Remove all static state from posixmodule (GH-15892)
eduardo-elizondo Nov 5, 2019
bf17d41
bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)
jdemeyer Nov 5, 2019
56698d5
bpo-38696: Fix usage example of HTTPStatus (GH-17066)
ammaraskar Nov 5, 2019
6c4c45e
bpo-38692: Add os.pidfd_open. (GH-17063)
benjaminp Nov 6, 2019
5c0c325
closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)
benjaminp Nov 6, 2019
519cb87
bpo-38716: stop rotating handlers from setting inherited namer and ro…
l0rb Nov 6, 2019
7f46049
bpo-38382: Document the early-out behavior for a zero (GH-17037)
rhettinger Nov 7, 2019
9def81a
bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-…
vsajip Nov 7, 2019
991b02d
update a deprecated assert in logging tests (GH-17079)
l0rb Nov 7, 2019
d12d0e7
bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)
vstinner Nov 7, 2019
6cbc84f
bpo-38613: Optimize set operations of dict keys. (GH-16961)
methane Nov 7, 2019
befa032
bpo-22367: Add tests for fcntl.lockf(). (GH-17010)
corona10 Nov 7, 2019
7e43373
bpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)
vstinner Nov 8, 2019
fc6b1bf
Clarify amount of dots between package and subpackage (GH-17092)
susan-shu-c Nov 8, 2019
e27449d
bpo-38635: Simplify decoding the ZIP64 extra field and make it tolera…
serhiy-storchaka Nov 9, 2019
af46450
Minor readability improvement for argument handling in itertools.repe…
rhettinger Nov 10, 2019
84ac437
bpo-38761: Register WeakSet as a MutableSet (GH-17104)
rhettinger Nov 11, 2019
a0ed99b
bpo-38438: Simplify argparse "star nargs" usage. (GH-17106)
brandtbucher Nov 11, 2019
98480ce
bpo-38771: Explict test for None in code example (GH-17108)
jonathan-scholbach Nov 12, 2019
051ff52
bpo-38565: add new cache_parameters method for lru_cache (GH-16916)
Zheaoli Nov 12, 2019
733b9a3
bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-1…
rhettinger Nov 12, 2019
1b5aa07
Add is_reading() method to _UnixReadPipeTransport
Nov 4, 2019
1dbad62
Add new test case file for UNIX pipe transport functional tests
Nov 12, 2019
dd3c0d3
Merge branch 'fix-issue-38314' of github.com:callumquick/cpython into…
Nov 12, 2019
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
Prev Previous commit
Next Next commit
Minor readability improvement for argument handling in itertools.repe…
…at() (GH-17101)
  • Loading branch information
rhettinger authored Nov 10, 2019
commit af46450bb97ab9bd38748e75aa849c29fdd70028
10 changes: 5 additions & 5 deletions Modules/itertoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4256,17 +4256,17 @@ repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
repeatobject *ro;
PyObject *element;
Py_ssize_t cnt = -1, n_kwds = 0;
Py_ssize_t cnt = -1, n_args;
static char *kwargs[] = {"object", "times", NULL};

n_args = PyTuple_GET_SIZE(args);
if (kwds != NULL)
n_args += PyDict_GET_SIZE(kwds);
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs,
&element, &cnt))
return NULL;

if (kwds != NULL)
n_kwds = PyDict_GET_SIZE(kwds);
/* Does user supply times argument? */
if ((PyTuple_Size(args) + n_kwds == 2) && cnt < 0)
if (n_args == 2 && cnt < 0)
cnt = 0;

ro = (repeatobject *)type->tp_alloc(type, 0);
Expand Down