[issue46277] '''...''' error

2022-01-06 Thread Mark Dickinson
Mark Dickinson added the comment: https://github.com/ipython/ipython/issues/12843 looks very closely related, and may be the exact same bug. -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue46

[issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE

2022-01-06 Thread Mark Shannon
Mark Shannon added the comment: New changeset 3db762db72cc0da938614b1e414abb1e12ca4094 by penguin_wwy in branch 'main': bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019) https://github.com/python/cpython/commit/3db762db72cc0da938614b1e414abb1e12ca4094 -

[issue40222] "Zero cost" exception handling

2022-01-06 Thread Mark Shannon
Mark Shannon added the comment: Yes. -- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue45256] Remove the usage of the C stack in Python to Python calls

2022-01-06 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46039] Break up the YIELD_FROM instruction.

2022-01-06 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-06 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +eric.snow ___ Python tracker <https://bugs.python.org/issue46166> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45923] Improve performance of sys.settracing based tools.

2022-01-06 Thread Mark Shannon
Mark Shannon added the comment: New changeset e028ae99ecee671c0e8a3eabb829b5b2acfc4441 by Mark Shannon in branch 'main': bpo-45923: Handle call events in bytecode (GH-30364) https://github.com/python/cpython/commit/e028ae99ecee671c0e8a3eabb829b5

[issue46225] f_lasti behaves differently for lambdas returned from loops

2022-01-06 Thread Mark Shannon
Mark Shannon added the comment: Are you using `f_lasti == -1` as a proxy for "is this an actual call or a resumption after a yield"? Ultimately PEP 669 will provide all the information you could need to differentiate different events. In the meantime... We now make all &qu

[issue46031] add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE

2022-01-06 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46272] Fix bitwise and logical terminology in python.gram

2022-01-06 Thread Mark Dickinson
Mark Dickinson added the comment: > In the section "Comparison operators", all mentions of "bitwise" should be > "binary". Should they? The corresponding line from https://docs.python.org/3/reference/expressions.html#comparisons is comparison

[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: @swirsz: Thanks for the report. Most of these look like false positives: we're intentionally making use of C's unsigned arithmetic behaviour. Note that these are technically *not* overflows. As the C standard itself says, in C99 ยง6.2.5, paragra

[issue46203] Add timeout for Windows build steps

2022-01-09 Thread Mark Dickinson
Change by Mark Dickinson : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue46203> ___ ___ Pyth

[issue45569] Drop support for 15-bit PyLong digits?

2022-01-09 Thread Mark Dickinson
Change by Mark Dickinson : -- pull_requests: +28703 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30497 ___ Python tracker <https://bugs.python.org/issu

[issue45569] Drop support for 15-bit PyLong digits?

2022-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: First step in GH-30497, which changes the default to 30-bit digits unconditionally, instead of having the default be platform dependent. -- ___ Python tracker <https://bugs.python.org/issue45

[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for checking, Steven. Your report also helped me to notice a minor portability bug (at Objects/longobject.c:288, where the wrong type is used in a cast); a fix is in GH-30496. -- ___ Python tracker <ht

[issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong

2022-01-09 Thread Mark Dickinson
New submission from Mark Dickinson : PR GH-27832 inadvertently (I believe) introduced a couple of changes to PyLong_FromLong that didn't make a lot of sense: an (unsigned long) cast was replaced with (twodigits), and a digit count variable (counting number of PyLong digits in a C long

[issue46311] Clean up PyLong_FromLong and PyLong_FromLongLong

2022-01-09 Thread Mark Dickinson
Change by Mark Dickinson : -- keywords: +patch pull_requests: +28705 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30496 ___ Python tracker <https://bugs.python.org/issu

[issue46272] Fix bitwise and logical terminology in python.gram

2022-01-09 Thread Mark Dickinson
Change by Mark Dickinson : -- keywords: +patch pull_requests: +28706 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30499 ___ Python tracker <https://bugs.python.org/issu

[issue46272] Fix bitwise and logical terminology in python.gram

2022-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: > So, the meaning of these names like this is, "lt followed by an optional > bitwise_or expression"? That's certainly how I was reading it. -- ___ Python tracker <https://bu

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Mark Shannon added the comment: Thanks, Ned. -- assignee: -> Mark.Shannon priority: normal -> release blocker type: -> behavior ___ Python tracker <https://bugs.python.or

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +28716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30513 ___ Python tracker <https://bugs.python.org/issu

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Mark Shannon added the comment: Pablo, I've marked this as a release blocker so this bug doesn't get into 3.11a4. -- keywords: -patch nosy: +pablogsal stage: patch review -> ___ Python tracker <https://bugs.pytho

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Mark Shannon added the comment: New changeset ec0c392f34ee2474ceacf66881f05546b540e2d1 by Mark Shannon in branch 'main': bpo-46314: Remove extra RESUME when compiling a lamdba. (GH-30513) https://github.com/python/cpython/commit/ec0c392f34ee2474ceacf66881f055

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Mark Shannon added the comment: Ok, I'll add a news item in that case. -- ___ Python tracker <https://bugs.python.org/issue46314> ___ ___ Python-bugs-list m

[issue46314] Stray RESUME opcode for unused lambda

2022-01-10 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +28718 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30515 ___ Python tracker <https://bugs.python.org/issu

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-01-10 Thread Mark Shannon
New submission from Mark Shannon : Most calls (not those with *args and/or **kwargs) are compiled to the `CALL_NO_KW` and `CALL_KW` instructions, possibly with a `PRECALL_METHOD` prefix. We want to unify the `CALL_NO_KW` and `CALL_KW` instructions into a single `CALL` instruction and add

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-10 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +28720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30518 ___ Python tracker <https://bugs.python.org/issu

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-10 Thread Mark Shannon
Change by Mark Shannon : -- assignee: -> Mark.Shannon ___ Python tracker <https://bugs.python.org/issue46331> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-11 Thread Mark Shannon
Mark Shannon added the comment: New changeset bd04fac7eb929cd11ab6985deb61d9780447fbff by Mark Shannon in branch 'main': bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518) https://github.com/python/cpython/commit/bd04fac7eb929cd11ab6985deb61d9

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-11 Thread Mark Shannon
Mark Shannon added the comment: Ned, does this fix work for you? -- status: pending -> open ___ Python tracker <https://bugs.python.org/issue46331> ___ ___ Py

[issue46344] 3.11: except/else/if/raise traced incorrectly

2022-01-11 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +iritkatriel ___ Python tracker <https://bugs.python.org/issue46344> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46356] [C API] Enforce usage of PyFrame_GetBack()

2022-01-12 Thread Mark Shannon
Mark Shannon added the comment: f_lineno is not part of the API. No field in PyFrameObject is. I don't know how we can stop people from using them though. If they don't know better than pulling data out of undocumented internal struct, then I'm not sure an underscore prefix i

[issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11

2022-01-12 Thread Mark Shannon
Mark Shannon added the comment: Are there any C programming guides we can link to, that explain API use? I would hope that competent C programmers would know not to read or write to undocumented fields. But if they come from a Python background, that might not be obvious. If the advice for

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-12 Thread Mark Shannon
Change by Mark Shannon : -- assignee: Mark.Shannon -> keywords: -patch stage: resolved -> ___ Python tracker <https://bugs.python.org/issue46331> ___ ___

[issue46314] Stray RESUME opcode for unused lambda

2022-01-12 Thread Mark Shannon
Mark Shannon added the comment: The news item was added in PR 30515 -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45569] Drop support for 15-bit PyLong digits?

2022-01-12 Thread Mark Dickinson
Mark Dickinson added the comment: Adding Stefan Behnel to the nosy, since Cython is one of the few projects that might be directly affected by this change. Stefan: can you see any potential problems with changing the default to 30 here? -- nosy: +scoder

[issue46361] Small ints aren't always cached properly

2022-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: I don't *think* we currently rely on small integers being cached anywhere in the implementation (and neither do we guarantee anywhere in the docs that small integers will be cached), so as far as I can tell these omissions shouldn't lead to us

[issue46361] Small ints aren't always cached properly

2022-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. This sort of thing is a little dodgy, though (despite the comment that it's "okay"): https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Modules/mathmodule.c#L939 PyObject *zero = _PyLong_GetZero();

[issue46361] Small ints aren't always cached properly

2022-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: And there are some similar things going on in rangeobject.c. https://github.com/python/cpython/blob/1de60155d5d01be2924e72fb68dd13d4fd00acd7/Objects/rangeobject.c#L598 if (r->step == _PyLong_GetOne()) { return idx; } Ag

[issue45786] Avoid allocating when exiting frame; it may be unsafe.

2022-01-13 Thread Mark Shannon
Mark Shannon added the comment: With https://bugs.python.org/issue45963 both frame objects and generators contain space for the frame, so no allocation occurs on exit. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue45569] Drop support for 15-bit PyLong digits?

2022-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Stefan. I think I'm going to go ahead with the first step of making 30-bit digits the default, then, but leaving the 15-bit digit option present. > That said, if we decide to keep 15-bit digits in the end, I wonder if > "SIZEOF_VOID

[issue46374] Assertion failed in ceval.c

2022-01-14 Thread Mark Shannon
Mark Shannon added the comment: I can reproduce this on linux. The problem is that when closing a generator that has not started, the frame may not be in a valid state (hence the assertion failure). This should be fixed by implementing https://github.com/faster-cpython/ideas/discussions

[issue46331] 3.11: tracing revisits class line after class docstring

2022-01-14 Thread Mark Shannon
Change by Mark Shannon : -- assignee: -> Mark.Shannon keywords: +patch stage: -> patch review ___ Python tracker <https://bugs.python.org/issue46331> ___ __

[issue45569] Drop support for 15-bit PyLong digits?

2022-01-14 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 025cbe7a9b5d3058ce2eb8015d3650e396004545 by Mark Dickinson in branch 'main': bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497) https://github.com/python/cpython/commit/025cbe7a9b5d3058ce2eb8015d3650

[issue46258] Minor algorithmic improvements for math.isqrt

2022-01-15 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset d02c5e9b55a8651b7d396ac3f2bdedf1fc1780b5 by Mark Dickinson in branch 'main': bpo-46258: Streamline isqrt fast path (#30333) https://github.com/python/cpython/commit/d02c5e9b55a8651b7d396ac3f2bded

[issue46258] Minor algorithmic improvements for math.isqrt

2022-01-15 Thread Mark Dickinson
Change by Mark Dickinson : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue46258> ___ ___ Pyth

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: [Terry] > To avoid the intermediate set, [...] It's not quite as bad as that: there _is_ no intermediate set (or if you prefer, the intermediate set is the same object as the final set), since the frozenset call returns its argument unchanged

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: > That's not always the case though. Sorry, yes - I see. We're not creating a frozenset from a frozenset - we're creating a frozenset from a regular set from a frozenset. :-( Sorry for the noise. --

[issue46372] int/float specializations should mutate the LHS in-place when possible

2022-01-16 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue46372> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46361] Small ints aren't always cached properly

2022-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 5cd9a162cd02a3d0f1b0a182d80feeb17439e84f by Brandt Bucher in branch 'main': bpo-46361: Fix "small" `int` caching (GH-30583) https://github.com/python/cpython/commit/5cd9a162cd02a3d0f1b0

[issue46361] Small ints aren't always cached properly

2022-01-16 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-17 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: -mark.dickinson ___ Python tracker <https://bugs.python.org/issue46393> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-01-17 Thread Mark Shannon
Mark Shannon added the comment: This has the same root cause as https://bugs.python.org/issue46374: closing the unused generator expression exposes the generator's frame before it has been initialized. -- ___ Python tracker &

[issue46409] Add a new bytecode instruction to create generators

2022-01-17 Thread Mark Shannon
New submission from Mark Shannon : (including coroutines, and async generators) We now make the start and resumption of Python functions explicit in the bytecode which allows us to initialize frames in the bytecode without exposing incomplete frames tracing, the GC etc. However, we still

[issue46409] Add a new bytecode instruction to create generators

2022-01-17 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +28836 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30633 ___ Python tracker <https://bugs.python.org/issu

[issue46389] 3.11: unused generator comprehensions cause f_lineno==None

2022-01-17 Thread Mark Shannon
Change by Mark Shannon : -- assignee: -> Mark.Shannon ___ Python tracker <https://bugs.python.org/issue46389> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue46374] Assertion failed in ceval.c

2022-01-17 Thread Mark Shannon
Change by Mark Shannon : -- priority: normal -> release blocker ___ Python tracker <https://bugs.python.org/issue46374> ___ ___ Python-bugs-list mai

[issue46405] Warning compiling main on Windows

2022-01-17 Thread Mark Shannon
Mark Shannon added the comment: New changeset a4bc2218d270c4c7a898c8b3967c8c271afe9abe by Kumar Aditya in branch 'main': bpo-46405: fix msvc compiler warnings (GH-30627) https://github.com/python/cpython/commit/a4bc2218d270c4c7a898c8b3967c8c

[issue46161] `class A(1, 2, 3, **d): pass` gives bad bytecode

2022-01-17 Thread Mark Shannon
Mark Shannon added the comment: New changeset c118c2455c95baea08045dc64963600b7a56b6fd by zq1997 in branch 'main': bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235) https://github.com/python/cpython/commit/c118c2455c95baea08045dc6496360

[issue46423] CLI: Addition assignment for tuples

2022-01-18 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report. This is a long-standing and known behaviour. It's been discussed a good few times before, and (quite apart from potential problems with backwards compatibility) no-one has yet come up with convincing alternative behaviours.

[issue46444] Wrong value of pi for larger values using math.cos() function

2022-01-20 Thread Mark Dickinson
Mark Dickinson added the comment: Hi Darshan. This isn't a bug in Python. You're running into the limitations of floating-point arithmetic. There's a lot of good material on those limitations available on the web, starting with Python's own tutorial: https://docs.p

[issue46409] Add a new bytecode instruction to create generators

2022-01-20 Thread Mark Shannon
Mark Shannon added the comment: New changeset b04dfbbe4bd7071d46c8688c2263726ea31d33cd by Mark Shannon in branch 'main': bpo-46409: Make generators in bytecode (GH-30633) https://github.com/python/cpython/commit/b04dfbbe4bd7071d46c8688c226372

[issue46409] Add a new bytecode instruction to create generators

2022-01-20 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2022-01-20 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45947] Place dict (and values) pointers at a fixed (negative) offset from the base of the object.

2022-01-20 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43683] Handle generator (and coroutine) state in the bytecode.

2022-01-20 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +28914 pull_request: https://github.com/python/cpython/pull/30723 ___ Python tracker <https://bugs.python.org/issue43

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Mark Shannon
Mark Shannon added the comment: While the various frame and debugger PEPs that are open offer a better solution to this, they might not be accepted for 3.11. So I'd like to revisit this. Removing the calls to `PyFrame_FastToLocals` and friends cuts the overhead of tracing down a l

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Mark Shannon
Mark Shannon added the comment: Yes the PR has all the changes. It is just the changes sysmodule.c that you need: https://github.com/python/cpython/pull/23028/files#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cb

[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Mark Shannon
Mark Shannon added the comment: Or you can use this branch: https://github.com/faster-cpython/cpython/tree/dont-fast-to-locals-in-trampoline -- ___ Python tracker <https://bugs.python.org/issue42

[issue45995] string formatting: normalize negative zero

2022-01-22 Thread Mark Dickinson
Mark Dickinson added the comment: [John] > Mark, would you give it a review this month? Apologies; my holiday-break free time was nobbled from unexpected quarters. I can't promise to find time this month, but I can promise to try. I did at least skim through the PR, and while t

[issue29882] Add an efficient popcount method for integers

2022-01-22 Thread Mark Dickinson
Change by Mark Dickinson : -- pull_requests: +28979 pull_request: https://github.com/python/cpython/pull/30794 ___ Python tracker <https://bugs.python.org/issue29

[issue29882] Add an efficient popcount method for integers

2022-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 83a0ef2162aa379071e243f1b696aa6814edcd2a by Mark Dickinson in branch 'main': bpo-29882: Fix portability bug introduced in GH-30774 (#30794) https://github.com/python/cpython/commit/83a0ef2162aa379071e243f1b696aa

[issue46406] optimize int division

2022-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset c7f20f1cc8c20654e5d539552604362feb9b0512 by Gregory P. Smith in branch 'main': bpo-46406: Faster single digit int division. (#30626) https://github.com/python/cpython/commit/c7f20f1cc8c20654e5d53955260436

[issue46406] optimize int division

2022-01-23 Thread Mark Dickinson
Change by Mark Dickinson : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue46406> ___ ___ Pyth

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Mark Shannon
Mark Shannon added the comment: Is this a bug? Signal handling in Python is asynchronous. https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers The example code tests whether the interpreter responds synchronously and immediately. If you add `for _in range(1

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +tim.peters ___ Python tracker <https://bugs.python.org/issue46488> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-24 Thread Mark Shannon
Mark Shannon added the comment: > So it's also a threads scheduling issue, no? No, it isn't. The interpreter checks the eval breaker frequently enough. It checks on all back edges and on all calls to Python functions. The test probably needs to be fixed, or extended. It is sign

[issue43683] Handle generator (and coroutine) state in the bytecode.

2022-01-24 Thread Mark Shannon
Mark Shannon added the comment: New changeset 0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 by Mark Shannon in branch 'main': bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723) https://github.com/python/cpython/commit/0367a36fdc36b9c909c4d5acf7cde6

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-01-24 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +29036 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30855 ___ Python tracker <https://bugs.python.org/issu

[issue46420] Use NOTRACE_DISPATCH in specialized opcodes

2022-01-25 Thread Mark Shannon
New submission from Mark Shannon : New changeset 96bf84d57a7c29544866a6c20231603049de4919 by Dennis Sweeney in branch 'main': bpo-46420: Use NOTRACE_DISPATCH() in specialized opcodes (GH-30652) https://github.com/python/cpython/commit/96bf84d57a7c29544866a6c20231603049de4919 -

[issue46532] Improve effeciency of PRECALL/CALL instructions

2022-01-26 Thread Mark Shannon
New submission from Mark Shannon : The PRECALL/CALL bytecode pair for calls is new (still in review at time of writing) and is not as efficient as it could be. Some possible improvements are: Transfer refcount of func when making a frame. NULL call_shape.kwnames after use instead of in

[issue46532] Improve effeciency of PRECALL/CALL instructions

2022-01-26 Thread Mark Shannon
Mark Shannon added the comment: Possibly consider replacing the specializations for `str(arg)` and `tuple(arg)` with a more general bytecode that can be used for other objects as well. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46533] Specialize for staticmethods and classmethods

2022-01-26 Thread Mark Shannon
New submission from Mark Shannon : Calls of the form `x.m(args)` where either `x = X` or x = X()` and X is a class, and `m` is a classmethod or staticmethod are not currently specialized. Typically the `x.m()` will translate to: LOAD_FAST x LOAD_METHOD "m" PRECALL_METHOD 0 CAL

[issue46533] Specialize for staticmethods and classmethods

2022-01-26 Thread Mark Shannon
Mark Shannon added the comment: For classmethods, I expect the savings to come from not creating a bound-method and from better specialization of the following call. classmethod case: >>> class C: ... @classmethod ... def m(*args): ... pass ... >>> C.m

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-01-27 Thread Mark Shannon
Mark Shannon added the comment: Yes, we should expose the tuple of variable names, both in Python and in the C-API. Would something like `PyCodeObject_GetVariableName()` and `PyCodeObject_GetVariableKind()` work? In the meantime, since you were reading `co_varnames` directly, why not read

[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: Low priority, but it may also be worth updating the implementation of `Vec2D.__abs__`. It currently looks like this: def __abs__(self): return (self[0]**2 + self[1]**2)**0.5 But would be more robust if it used hypot: def __abs__(self

[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: Apologies; looks like I'm out of date on this. It's already using hypot, which makes it more than a little worrying that it doesn't get the right answer for `Vec2D(6, 8)`. -- ___ Python

[issue44734] turtle: tests for Vec2D.__abs__ are too strict

2022-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry again, all; I failed to read everything that was going on here. The test *wasn't* failing with the hypot-based version of Vec2D.__abs__ that's in the main branch; only with the "**0.5"-based version that was still in the older bra

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread Mark Shannon
Mark Shannon added the comment: New changeset 26b0482393a313e3bda364a35e7417e9db52c1c4 by Christian Heimes in branch 'main': bpo-46476: Simplify and fix _PyStaticCode_Dealloc (GH-30965) https://github.com/python/cpython/commit/26b0482393a313e3bda364a35e7417

[issue46528] Simplify the VM's stack manipulations

2022-01-27 Thread Mark Shannon
Mark Shannon added the comment: Timings for individual instructions are a bit meaningless, as out-of-order execution and speculation on modern CPUs makes it hard to pin down the timing of anything. I did an experiment to double the number of instructions. It slowed things down by ~10%, so

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-28 Thread Mark Shannon
Mark Shannon added the comment: It's plenty slow on linux as well. I like the idea of starting the slower tests first. The long tail of slow tests is annoying when running `make -j12 test`. -- nosy: +Mark.Shannon ___ Python tracker &

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-01-28 Thread Mark Shannon
Mark Shannon added the comment: New changeset 89fd7c34520aac493a8784a221366ed04452612b by Mark Shannon in branch 'main': bpo-46329: Split calls into precall and call instructions. (GH-30855) https://github.com/python/cpython/commit/89fd7c34520aac493a8784a221366e

[issue46072] Unify handling of stats in the CPython VM

2022-01-28 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29168 pull_request: https://github.com/python/cpython/pull/30989 ___ Python tracker <https://bugs.python.org/issue46

[issue46533] Specialize for staticmethods and classmethods

2022-01-28 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +29169 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30990 ___ Python tracker <https://bugs.python.org/issu

[issue46072] Unify handling of stats in the CPython VM

2022-01-28 Thread Mark Shannon
Mark Shannon added the comment: New changeset 90ab138bbdc63763ad825ed6d4821367c09c4015 by Mark Shannon in branch 'main': bpo-46072: Add simple stats for Python calls. (GH-30989) https://github.com/python/cpython/commit/90ab138bbdc63763ad825ed6d48213

[issue17206] Py_XDECREF() expands its argument multiple times

2022-01-30 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29209 pull_request: https://github.com/python/cpython/pull/30855 ___ Python tracker <https://bugs.python.org/issue17

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-01-31 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29216 pull_request: https://github.com/python/cpython/pull/31033 ___ Python tracker <https://bugs.python.org/issue46

[issue46451] Tracing causes module globals to be mutated when calling functions from C

2022-02-01 Thread Mark Shannon
Mark Shannon added the comment: Can you reproduce this in pure Python? If not, can you produce a minimal reproducer using just NumPy? If you can't do either, I'm going to have to assume that this is a NumPy or Pandas bug. Maybe NumPy or Pandas is accessing CPython internals, but n

[issue46561] Descriptor resolution should own arguments passed to descriptors

2022-02-01 Thread Mark Shannon
Mark Shannon added the comment: # This needs to be C code for this to fail, I'm writing it in Python for clarity and brevity class D: def __get__(self, instance, owner): del C.d # There are now no strong references to self self.whatever # Access to freed m

[issue46072] Unify handling of stats in the CPython VM

2022-02-01 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29233 pull_request: https://github.com/python/cpython/pull/31051 ___ Python tracker <https://bugs.python.org/issue46

<    1   2   3   4   5   6   7   8   9   10   >