Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
52bf470
Fix atexitmodule doc (GH-21456)
linchiwei123 Jul 26, 2020
f1d40f9
bpo-41384: Raise TclError in tkinter.OptionMenu (GH-21601)
Akuli Jul 27, 2020
5798f78
bpo-41340: Removed fallback implementation for strdup (GH-21634)
Jul 27, 2020
855e688
bpo-31904: Fix test_ftplib failures for VxWorks RTOS (GH-19447)
pxinwr Jul 27, 2020
67987ac
bpo-41401: Fix test_fspath_support in test_io. (GH-21640)
serhiy-storchaka Jul 27, 2020
72cabb2
bpo-40939: Use the new grammar for the grammar specification document…
pablogsal Jul 27, 2020
b3fbff7
bpo-40939: Remove even more references to the old parser (GH-21642)
lysnikolaou Jul 27, 2020
13efaec
bpo-41045: Document debug feature of f-strings ('=') (GH-21509)
amaajemyfren Jul 27, 2020
1332226
Validate the AST produced by the parser in debug mode (GH-21643)
pablogsal Jul 27, 2020
c82dda1
bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587)
ZackerySpytz Jul 28, 2020
5e38267
bpo-41328: Replace mention of Hudson CI with Travis CI and AppVeyor (…
Jul 28, 2020
37a06cb
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
zooba Jul 28, 2020
34cd3e9
Fix `List_Append` description, list is extracted at TOS1[-i] (GH-21465)
zhangyangyu Jul 28, 2020
f6a16e8
Remove incorrect mention of method.__class__ in descriptor docs (GH-2…
Jongy Jul 28, 2020
a74eea2
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH…
benjaminp Jul 29, 2020
ba18c0b
bpo-41426 Fix grammar in curses.getmouse() documentation (GH-21677)
s3bw Jul 29, 2020
6e8128f
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-…
markshannon Jul 30, 2020
cadda52
bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694)
tirkarthi Jul 31, 2020
5c32709
bpo-41421: Algebraic simplification for random.paretovariate() (GH-21…
rhettinger Aug 1, 2020
6a613f9
random module: Convert a "while 1" to "while True (GH-21700)
rhettinger Aug 2, 2020
ab72fde
bpo-40979: refactored typing.rst; (mostly) same content, new sub-sect…
ramalho Aug 2, 2020
ecaf949
bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707)
nmaynes Aug 3, 2020
c36dbac
bpo-41425: Make tkinter doc example runnable (GH-21706)
nerandell Aug 3, 2020
488512b
A (very) slight speed improvement for iterating over bytes (#21705)
gvanrossum Aug 3, 2020
a7f5d93
bpo-40275: Use new test.support helper submodules in tests (GH-21449)
shihai1991 Aug 3, 2020
bb0424b
bpo-40275: Use new test.support helper submodules in tests (GH-21451)
shihai1991 Aug 3, 2020
4660597
bpo-40275: Use new test.support helper submodules in tests (GH-21448)
shihai1991 Aug 3, 2020
701b638
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH…
vstinner Aug 3, 2020
bde48fd
bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721)
vstinner Aug 4, 2020
602a971
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
vstinner Aug 4, 2020
db6d9a5
bpo-41431: Optimize dict_merge for copy (GH-21674)
methane Aug 4, 2020
da4e09f
bpo-36982: Add support for extended color functions in ncurses 6.1 (G…
hpjansson Aug 4, 2020
604bba1
bpo-40275: Use new test.support helper submodules in tests (GH-21452)
shihai1991 Aug 4, 2020
c7decc2
bpo-40275: Use new test.support helper submodules in tests (GH-21727)
shihai1991 Aug 4, 2020
582aaf1
bpo-41463: Generate information about jumps from 'opcode.py' rather t…
markshannon Aug 4, 2020
270b4ad
bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479)
methane Aug 5, 2020
8f4380d
bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH…
isidentical Aug 5, 2020
15edaec
bpo-40989: Fix compiler warning in winreg.c (GH-21722)
vstinner Aug 5, 2020
52f9842
bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736)
ericfrederich Aug 5, 2020
79bb2c9
bpo-40275: Use new test.support helper submodules in tests (GH-21743)
shihai1991 Aug 6, 2020
777b611
bpo-41492: Fixes the description appearing in UAC prompts on Windows …
zooba Aug 6, 2020
5f0769a
bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734)
nmaynes Aug 6, 2020
d9323a8
bpo-41493: Refactoring dictresize (GH-21751)
methane Aug 7, 2020
3405e05
bpo-41440: add os.cpu_count() support for VxWorks RTOS (GH-21685)
pxinwr Aug 7, 2020
5463635
bpo-39871: Fix an error in a news entry (GH-21749)
ZackerySpytz Aug 7, 2020
46e19b6
bpo-41098: Doc: Add missing deprecated directives (GH-21162)
methane Aug 7, 2020
598a951
bpo-40275: Use new test.support helper submodules in tests (GH-21764)
shihai1991 Aug 7, 2020
f44693e
bpo-41477: Make ctypes optional in test_genericalias (GH-21766)
vstinner Aug 7, 2020
e27a51c
bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768)
vstinner Aug 7, 2020
fcce8c6
bpo-40275: Use new test.support helper submodules in tests (GH-21772)
shihai1991 Aug 7, 2020
102b498
Update Azure Pipelines build to use Ubuntu 18.04 and move triggers in…
zooba Aug 7, 2020
705f145
Doc: Add a link to tutorial page from `open()` doc (GH-21737)
bbkane Aug 8, 2020
a4084b9
bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)
zkonge Aug 8, 2020
d94af3f
bpo-40275: Remove test helpers aliases in test.support (GH-21771)
shihai1991 Aug 8, 2020
c6f282f
bpo-40275: Use new test.support helper submodules in tests (GH-21785)
shihai1991 Aug 8, 2020
82ca8fa
bpo-41455: Provide a link to how the third generation is collected in…
ypankovych Aug 8, 2020
67acf74
Doc: Add output to example code in programming FAQ (GH-21346)
zhongjiajie Aug 8, 2020
e28b8c9
bpo-35018: Sax parser should provide user access to lexical handlers …
ZackerySpytz Aug 9, 2020
8b67bf9
Improve renamed test_run.RecursionLimitTest (GH-21794)
terryjreedy Aug 9, 2020
f2e161c
bpo-41468: Improve and test IDLE run error exit (GH-21798)
terryjreedy Aug 9, 2020
416f0b7
bpo-41514: Fix buggy IDLE test (GH-21808)
terryjreedy Aug 10, 2020
39042e0
bpo-41324 Add a minimal decimal capsule API (#21519)
skrah Aug 10, 2020
4ce6faa
bpo-16995: add support for base32 extended hex (base32hex) (GH-20441)
FFY00 Aug 10, 2020
eaa5517
bpo-40548: Fix "Check for source changes (pull_request)" GH Action jo…
vstinner Aug 10, 2020
85fdafa
Replace import_fresh_module in decimal test files (GH-21815)
skrah Aug 10, 2020
a02efe4
MSVC: The ARM command line should not define MASM. (#21817)
skrah Aug 10, 2020
490c542
bpo-40275: Fix failed test cases by using test helpers (GH-21811)
shihai1991 Aug 10, 2020
1d541c2
bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378)
koubaa Aug 11, 2020
fabd7bb
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21…
vstinner Aug 11, 2020
0ee0b29
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21…
vstinner Aug 11, 2020
e3c971c
Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773)
edreamleo Aug 11, 2020
af3a6a8
Add PEP 573 additions to What's New (GH-21374)
encukou Aug 11, 2020
76643c1
bpo-41475: Fix note in "What's new in 3.7" (#21733)
cool-RR Aug 11, 2020
b5f87b9
Call randseed() before other imports in deccheck.py (GH-21834)
skrah Aug 11, 2020
0dfee33
Fix typo (GH-21820)
chrisyeh96 Aug 11, 2020
0e95bbf
bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825)
vstinner Aug 12, 2020
369a1cb
bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838)
vstinner Aug 12, 2020
6e0b788
Catch all skip_handler cases (GH-21842)
skrah Aug 12, 2020
423e77d
bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)
vstinner Aug 12, 2020
8ecc0c4
bpo-1635741: Clean sysdict and builtins of interpreter at exit (GH-21…
shihai1991 Aug 12, 2020
c51db0e
bpo-41531: Fix compilation of dict literals with more than 0xFFFF ele…
pablogsal Aug 13, 2020
e087f7c
bpo-1635741: Port _winapi ext to multi-stage init (GH-21371)
koubaa Aug 13, 2020
43577c0
bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)
vstinner Aug 13, 2020
46d10b1
bpo-40204: Fix duplicates in the documentation (GH-21857)
vstinner Aug 13, 2020
c818b15
bpo-41520: Fix second codeop regression (GH-21848)
terryjreedy Aug 13, 2020
20ae565
bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-…
vstinner Aug 13, 2020
d3ded08
bpo-40204: Add :noindex: in the documentation (GH-21859)
vstinner Aug 13, 2020
0eb9deb
bpo-41066: Update the comparison section for os vs pathlib (GH-21261)
srinivasreddy Aug 13, 2020
474652f
bpo-40204, doc: Fix syntax of C variables (GH-21846)
vstinner Aug 13, 2020
a3eae43
Fixed comment about pathlib.link_to: it was added in 3.8, not changed…
facundobatista Aug 13, 2020
6444ca9
bpo-41526: Fixed layout of final page of the installer (GH-21871)
zooba Aug 13, 2020
e55de68
bpo-41410: Fix outdated info in mkstemp docs (GH-21701)
xrisk Aug 14, 2020
87d8287
bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965)
pganssle Aug 14, 2020
bb0b085
bpo-40204: Fix reference to terms in the doc (GH-21865)
vstinner Aug 14, 2020
fa5d725
Fix typo in typing doc (GH-21879)
iritkatriel Aug 14, 2020
40e700a
bpo-40878: xlc cannot handle C99 extern inline. (GH-21887)
skrah Aug 15, 2020
495bd03
bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than O…
dimaqq Aug 15, 2020
39dab24
bpo-41540: AIX: skip test that is flaky with a default ulimit. (#21890)
skrah Aug 15, 2020
fff3c28
bpo-41513: Improve speed and accuracy of math.hypot() (GH-21803)
rhettinger Aug 16, 2020
2353d77
bpo-41503: Fix race between setTarget and flush in logging.handlers.M…
iritkatriel Aug 16, 2020
9700346
Update the comment of termios.c (#21886)
8vasu Aug 16, 2020
fbf43f0
bpo-41521: Rename blacklist parameter to not_exported (GH-21824)
vstinner Aug 17, 2020
1abeda8
bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)
vstinner Aug 17, 2020
99c0ee3
Fix typo in message from assert statement (GH-21283)
aboddie Aug 17, 2020
29f8429
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a m…
jamesba Aug 17, 2020
8aa163e
bpo-1635741: Explict GC collect after PyInterpreterState_Clear() (GH-…
shihai1991 Aug 17, 2020
c3dd7e4
bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)
pganssle Aug 17, 2020
0be7c21
Fix grammar in Doc/tutorial/controlflow.rst (GH-21885)
infrastation Aug 19, 2020
2ce3963
bpo-40994: Ungroup items in collections.abc documentation for improve…
sydneypemberton1986 Aug 20, 2020
1afb42c
bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914)
clebergnu Aug 20, 2020
12695f4
Doc: add a missing period (GH-21819)
deronnax Aug 20, 2020
d2b0ce6
Update references from travis-ci.org to travis-ci.com (GH-21919)
ewdurbin Aug 21, 2020
7173fc8
bpo-41573: Update release versions in General FAQ (GH-21915)
wyz23x2 Aug 21, 2020
802726a
Document vars behavior when __dict__ is missing (#21466)
andresdelfino Aug 21, 2020
fc7b41f
memoryview_patch initial commit
Aug 23, 2020
585fe5a
New Macro PyMemoryView_GET_SIZE(op)
Aug 27, 2020
cc45e07
WIP memoryiter_next
Aug 27, 2020
6e3a66e
Fix formatting
Aug 27, 2020
db8123d
WIP memoryiter_next - continuation
Aug 28, 2020
359d828
bugfix - improper macro
Aug 30, 2020
35ff087
Remove unused macro
Aug 30, 2020
1b5d6ee
Update Objects/memoryobject.c
Aug 31, 2020
f81a286
Update Objects/memoryobject.c
Aug 31, 2020
57b76b3
Update Objects/memoryobject.c
Aug 31, 2020
4386011
Error-handling + formatting
Aug 31, 2020
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
56 changes: 51 additions & 5 deletions Objects/memoryobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3161,9 +3161,9 @@ static PyMethodDef memory_methods[] = {
{NULL, NULL}
};

/////////////////////////////////////////////////////////////////////////////

static PyObject *memory_iter(PyObject *seq);
/**************************************************************************/
/* Memoryview Iterator */
/**************************************************************************/

typedef struct {
PyObject_HEAD
Expand All @@ -3172,17 +3172,65 @@ typedef struct {
} memoryiterobject;


static void memoryiter_dealloc(memoryiterobject *);
static int memoryiter_traverse(memoryiterobject * , visitproc, void *);
static PyObject * memoryiter_next(memoryiterobject *);
static PyObject *memory_iter(PyObject *);


static PyTypeObject PyMemoryIter_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
.tp_name = "memory_iterator",
.tp_basicsize = sizeof(memoryiterobject),
// methods
.tp_dealloc = (destructor)memoryiter_dealloc,
.tp_getattro = PyObject_GenericGetAttr,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
.tp_traverse = (traverseproc)memoryiter_traverse,
.tp_iter = PyObject_SelfIter,
.tp_iternext = (iternextfunc)memoryiter_next,
};


static void
memoryiter_dealloc(memoryiterobject *it)
{
_PyObject_GC_UNTRACK(it);
Py_XDECREF(it->it_seq);
PyObject_GC_Del(it);
}

static int
memoryiter_traverse(memoryiterobject *it, visitproc visit, void *arg)
{
Py_VISIT(it->it_seq);
return 0;
}

static PyObject *
memoryiter_next(memoryiterobject *it)
{
PyMemoryViewObject *seq;

assert(it != NULL);
seq = it->it_seq;
if (seq == NULL)
return NULL;
assert (PyMemoryView_Check(seq));

if (it->it_index < PyMemoryView_GET_SIZE(seq)){
PyObject * item = PyLong_FromSsize_t(seq->view.itemsize);
if (item != NULL)
++it->it_index;
return item;
}

it->it_seq = NULL;
Py_DECREF(seq);
return NULL;

}

static PyObject *
memory_iter(PyObject *seq)
{
Expand All @@ -3202,8 +3250,6 @@ memory_iter(PyObject *seq)
return (PyObject *)it;
}



PyTypeObject PyMemoryView_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"memoryview", /* tp_name */
Expand Down