New submission from Mark Shannon :
Currently, there are fourteen macros provided for stack manipulation.
Along with the fundamental, POP(), PUSH() and PEEK(n) the following eleven are
also provided:
TOP()
SECOND()
THIRD()
FOURTH()
SET_TOP(v)
SET_SECOND(v
Mark Shannon added the comment:
I'm proposing that we remove the nine macros above; the eleven listed, except
TOP() and SECOND().
They can be replaced by POP(), PUSH() and PEEK() without lost of functionality
or performance.
--
___
Python tr
New submission from Mark Shannon :
Generators have a "gi_running" attribute (coroutines have an equivalent
cr_running flag). Internally frame also has an executing flag.
We use these, plus the test `f_stacktop pointer == NULL`, to determine what
state a generator or frame is in.
I
Mark Shannon added the comment:
New changeset 33faf5c4f43e24766cf567bec89ad4c7f1491ff7 by Dong-hee Na in branch
'master':
bpo-40925: Remove unused stack macro SET_VALUE (GH-20783)
https://github.com/python/cpython/commit/33faf5c4f43e24766cf567bec89ad4
Mark Shannon added the comment:
This change combines the explicit state in `PyFrameObject.f_excuting` and
`PyGenObject.gi_running`, and the implicit state in `PyFrameObject.f_stacktop
== NULL` and `PyFrameObject.f_last == -1` into a single enum field in
`PyFrameObject`.
Since we no longer
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +1
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20803
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
Dennis, thanks for doing the benchmarking.
You seem to have removed rather more macros than I suggested,
but it probably won't make much difference to the results.
Since this may have a negative effect on performance and doesn't seem to be
popular,
Change by Mark Shannon :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue40925>
___
___
Pyth
Mark Shannon added the comment:
issue29590 is unrelated
--
___
Python tracker
<https://bugs.python.org/issue40941>
___
___
Python-bugs-list mailing list
Unsub
Mark Shannon added the comment:
New changeset 8b33961e4bc4020d8b2d5b949ad9d5c669300e89 by Chris Jerdonek in
branch 'master':
bpo-29590: fix stack trace for gen.throw() with yield from (#19896)
https://github.com/python/cpython/commit/8b33961e4bc4020d8b2d5b949ad9d5c669300e89
-
New submission from Mark Shannon :
Currently we perform various bytecode improvements as a pass on the code
objects after generating the code object.
This requires parsing the bytecode to find instructions, recreating the CFG,
and rewriting the line number table.
If we perform the
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +20653
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/21517
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
New changeset cb9879b948a19c9434316f8ab6aba9c4601a8173 by Mark Shannon in
branch 'master':
bpo-40941: Unify implicit and explicit state in the frame and generator objects
into a single value. (GH-20803)
https://github.com/python/cpyt
Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Shannon added the comment:
New changeset 6e8128f02e1d36e38e5866f9dc36e051caa47bc9 by Mark Shannon in
branch 'master':
bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)
https://github.com/python/cpython/commit/6e8128f02e1d36e38e58
New submission from Mark Shannon :
opcode.py declares which jumps are relative and which are absolute.
We duplicate that information in compile.c
We should generate lookup tables in opcodes.h and to repeating that information
in compile.c
--
messages: 374735
nosy: Mark.Shannon
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +20858
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21714
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
New changeset 582aaf19e8b94a70c1f96792197770d604ba0fdf by Mark Shannon in
branch 'master':
bpo-41463: Generate information about jumps from 'opcode.py' rather than
duplicating it in 'compile.c' (GH-21714)
https://gi
Mark Shannon added the comment:
New changeset c51db0ea40ddabaf5f771ea633b37fcf4c90a495 by Pablo Galindo in
branch 'master':
bpo-41531: Fix compilation of dict literals with more than 0x elements
(GH-21850)
https://github.com/python/cpython/commit/c51db0ea40ddabaf5f771ea633b37f
Mark Shannon added the comment:
@hroncok,
How did you discover this issue?
I'd like to clean up the code for creating dictionary literals and it might be
helpful to know where such huge dictionary literals exist.
I'm guessing that they are used as lookup tables for things like Uni
Mark Shannon added the comment:
A couple of things to fix here.
Firstly, the PREDICTion of POP_BLOCK in FOR_ITER shouldn't be there. POP_BLOCK
doesn't normally occur after a loop and hasn't since we removed "pseudo
exceptions" from the interpreter a couple of years
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +21126
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22026
___
Python tracker
<https://bugs.python.org/issu
Change by Mark Shannon :
--
assignee: -> Mark.Shannon
___
Python tracker
<https://bugs.python.org/issue41703>
___
___
Python-bugs-list mailing list
Unsubscrib
Mark Shannon added the comment:
https://bugs.python.org/issue39320 has a change note:
https://docs.python.org/3.9/whatsnew/changelog.html#python-3-9-0-beta-3
--
___
Python tracker
<https://bugs.python.org/issue41
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +21232
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22151
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
The change note for 33387 incorrectly referred to 32949
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
Thanks for the reminder. Tis' done.
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue41703>
___
Mark Shannon added the comment:
I agree with Serhiy, that `PyGen_` is a bad prefix.
Unless a function takes generator objects and *only* generators objects, then
it shouldn't have a `PyGen` prefix.
The API function is the C equivalent of obj.send(val).
The first parameter is an o
Mark Shannon added the comment:
Yury,
Why was the PR merged with a new API function `PyGen_Send`?
I explicitly said that any new API function should *not* start with `PyGen`,
nor should any function rely on generators and async "coroutines" sharing the
same memory layout.
If yo
Mark Shannon added the comment:
I can't resist the pun on typing.
`type(...)` is the least typing :)
More seriously,
>From a general consistency point of view,
if this is to be added, shouldn't `types.NoneType` and
`types.NotImplementedType` be added as well?
--
nosy:
Mark Shannon added the comment:
Thanks Victor.
Sorry I didn't get round to this sooner
--
___
Python tracker
<https://bugs.python.org/issue40941>
___
___
Mark Shannon added the comment:
It wasn't removed in 7d95e4072169911b228c9e42367afb5f17fd3db0,
just moved from object.h to dictobject.h
It was still part of the API at that point, I think.
--
___
Python tracker
<https://bugs.python.org/is
Mark Shannon added the comment:
iritkatriel
What error do you see and on what version?
--
___
Python tracker
<https://bugs.python.org/issue39934>
___
___
Pytho
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +21435
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22395
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
New changeset 02d126aa09d96d03dcf9c5b51c858ce5ef386601 by Mark Shannon in
branch 'master':
bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395)
https://github.com/python/cpython/commit/02d126aa09d96d03dcf9
Mark Shannon added the comment:
New changeset 17b5be0c0a3f74141014e06a660f1b5ddb002fec by Mark Shannon in
branch 'master':
bpo-41670: Remove outdated predict macro invocation. (GH-22026)
https://github.com/python/cpython/commit/17b5be0c0a3f74141014e06a660f1b
Mark Shannon added the comment:
Vladimir,
Thanks for adding PyIter_Send().
Don't forget to remove PyGen_Send() :)
--
___
Python tracker
<https://bugs.python.org/is
Mark Shannon added the comment:
What's the difference between removing it and making it properly private (i.e.
static)?
It's an irrelevant detail whether the code is inlined or in a helper function.
--
___
Python tracker
<https://bu
Mark Shannon added the comment:
Have you observed any slowdown or incorrect behaviour?
The 3.8 bytecode looks incorrect to me.
The C-API documentation doesn't prohibit callables from mutating the dictionary
they receive.
Unless a copy is made, then a callee could mutate `var`.
Change by Mark Shannon :
--
pull_requests: +21689
pull_request: https://github.com/python/cpython/pull/22723
___
Python tracker
<https://bugs.python.org/issue33
Mark Shannon added the comment:
Yes, thanks for pointing that out.
--
___
Python tracker
<https://bugs.python.org/issue33387>
___
___
Python-bugs-list mailin
Mark Shannon added the comment:
The test example has no reference to pytest in it.
How are you running it?
Can you produce a segmentation fault when run without pytest?
--
___
Python tracker
<https://bugs.python.org/issue42
Change by Mark Shannon :
--
pull_requests: +21825
pull_request: https://github.com/python/cpython/pull/22893
___
Python tracker
<https://bugs.python.org/issue42
Mark Shannon added the comment:
Is this worthwhile?
Statically, BUILD_CONST_KEY_MAP represents 0.14% of all bytecode instructions
in the standard library, but only 0.03% of the bytecode instructions in
functions.
Which suggests that dynamically only 1 in 3000 instructions executed is
Mark Shannon added the comment:
Could we get a pyperformance benchmark run on this please?
--
nosy: +Mark.Shannon
___
Python tracker
<https://bugs.python.org/issue41
Mark Shannon added the comment:
It sounds like the root cause is that annotations are repeatedly being
computed. We should address the underlying issue, IMO.
--
___
Python tracker
<https://bugs.python.org/issue42
Mark Shannon added the comment:
New changeset 0564aafb71a153dd0aca4b9266dfae9336a4f2cb by Neil Schemenauer in
branch 'master':
bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)
https://github.com/python/cpython/commit/0564aafb71a153dd0aca4b9266dfae
Mark Shannon added the comment:
Thanks Neil
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Shannon added the comment:
PEP 626 has just been accepted.
Could you please leave this until I have merged in the implementation of PEP
626 which uses a different line number table format
--
nosy: +Mark.Shannon
___
Python tracker
<ht
New submission from Mark Shannon :
Implementation of PEP 626 requires:
1. Implementation of the new line number table and associated APIs.
2. Removal of BEGIN_DO_NOT_EMIT_BYTECODE and END_DO_NOT_EMIT_BYTECODE from the
compiler as they do not understand line numbers and may remove lines from
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +22030
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23113
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
The following code is completely eliminated by the macros.
1. if 0:
2. secret_debugging_code()
PEP 626 says that all executed lines of code must generate trace events,
so we need to emit an instruction for line 1.
Dead code elimination will remove the
Change by Mark Shannon :
--
nosy: +nedbat
___
Python tracker
<https://bugs.python.org/issue42246>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
I'm not convinced that this is worth the effort.
The old functions aren't going away, so these additional functions provide no
real safety.
You can't stop C programmers trading away correctness for some perceived
performance benefit :(
If we
Mark Shannon added the comment:
New changeset 877df851c3ecdb55306840e247596e7b7805a60a by Mark Shannon in
branch 'master':
bpo-42246: Partial implementation of PEP 626. (GH-23113)
https://github.com/python/cpython/commit/877df851c3ecdb55306840e247596e
Change by Mark Shannon :
--
pull_requests: +22142
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23245
___
Python tracker
<https://bugs.python.org/issu
Change by Mark Shannon :
--
pull_requests: +22148
pull_request: https://github.com/python/cpython/pull/23251
___
Python tracker
<https://bugs.python.org/issue42
Mark Shannon added the comment:
New changeset cc75ab791dd5ae2cb9f6e0c3c5f734a6ae1eb2a9 by Mark Shannon in
branch 'master':
bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251)
https://github.com/python/cpython/commit/cc75ab791dd5ae2cb9f6e0c3c5f734
Change by Mark Shannon :
--
pull_requests: +22153
pull_request: https://github.com/python/cpython/pull/23256
___
Python tracker
<https://bugs.python.org/issue42
Mark Shannon added the comment:
New changeset fd009e606a48e803e7187983bf9a5682e938fddb by Mark Shannon in
branch 'master':
bpo-42246: Fix memory leak in compiler (GH-23256)
https://github.com/python/cpython/commit/fd009e606a48e803e7187983bf9a56
New submission from Mark Shannon :
The front-end of the bytecode compiler produces a broken CFG.
A number of "basic-block"s have terminators before their end.
This makes the back-end optimizations unsafe as they rely of a well-formed CFG.
The fix is simple. Insert a check that the C
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +22163
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23267
___
Python tracker
<https://bugs.python.org/issu
New submission from Mark Shannon :
PEP 626 doesn't cover which keywords are to be traced if they occur on a line
by themselves.
Some keywords, like `break`, in Python have behavior associated with them.
Others, like `else` are just syntax and don't do anything.
Currently, it is
Mark Shannon added the comment:
For top level functions (functions created once) this isn't going to make any
real difference. There might be a small speedup for function creation, but it
isn't going to be measurable.
For nested functions with annotations, where many functions a
Mark Shannon added the comment:
New changeset 266b462238bddec0213effad3650f19c56511e9f by Mark Shannon in
branch 'master':
bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267)
https://github.com/python/cpython/commit/266b462238bddec0213effad3650f1
Mark Shannon added the comment:
New changeset 48a9c0eb2a3304ea64d1b32fdf9db853d5d8c429 by Irit Katriel in
branch '3.9':
[3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395)
(GH-23303)
https://github.com/p
Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Shannon added the comment:
https://github.com/python/peps/pull/1722/
--
___
Python tracker
<https://bugs.python.org/issue42373>
___
___
Python-bugs-list m
Change by Mark Shannon :
--
pull_requests: +22384
pull_request: https://github.com/python/cpython/pull/23495
___
Python tracker
<https://bugs.python.org/issue42
New submission from Mark Shannon :
The frame object has a number of fields which belong to the generator object.
By creating a CoState struct, these fields can be moved to
generator/threadstate where they belong.
The interpreter no longer has to swap around exception state whenever
generators
Mark Shannon added the comment:
Amaury Forgeot d'Arc wrote:
>
> - Why is it called CoState? is it related to coroutines?
Yes it is related to coroutines, threads and generators *are*
(a limited form of) asymmetric coroutines, even if we don't usually
think of them tha
Mark Shannon added the comment:
Nick Coghlan wrote:
> Nick Coghlan added the comment:
>
> The division of responsibilities between generator objects and the eval loop
> is currently a little messy. The eval loop deals almost entirely with frame
> objects and also handles swa
New submission from Mark Shannon :
The proposed dictionary implementation allows sharing of keys & hashes between
dictionaries. This leads to substantial memory savings for object-oriented
programs. For non-OO programs the impact is negligible.
--
components: Interpreter Core
hgr
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24360/6a21f3b35e20.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Mark Shannon added the comment:
The important part is not the change of name, but wrapping them in a
struct which can be embedded in both PyThreadState and PyGenObject.
The state->exc_XXX trio of values are the currently handled exception
(sys.exc_info()) and are shadowed by genera
New submission from Mark Shannon :
The function test_set_reprs() includes the comment:
"Consequently, this test is fragile and implementation-dependent"
Changing the dictionary iteration ordering breaks it.
--
components: Tests
messages: 152272
nosy: Mark.Shannon
priori
Mark Shannon added the comment:
Barry A. Warsaw wrote:
> Barry A. Warsaw added the comment:
>
> On Jan 28, 2012, at 07:26 PM, Dave Malcolm wrote:
>
>> This turns out to pass without PYTHONHASHRANDOMIZATION in the
>> environment, and fail intermittently with it.
&g
New submission from Mark Shannon :
This only seems to apply to free variables, not local or cell variables.
The offending tests are lines 429 & 430 of Lib/test/test_dis.py
(tricky, code_info_tricky),
(co_tricky_nested_f, code_info_tricky_nested_f),
Changing PyDict_MINSIZE
New submission from Mark Shannon :
Changing PyDict_MINSIZE to 4 causes the following failure:
python -m test.test_packaging
...
Traceback (most recent call last):
File "/home/mark/python/cpython/Lib/runpy.py", line 160, in
_run_module_as_main
"__main__", fname, load
New submission from Mark Shannon :
Changing PyDict_MINSIZE to 4 causes the following failure
python -m test.test_trace
...
==
ERROR: test_coverage (__main__.TestCoverage
Mark Shannon added the comment:
Does this really need a PEP?
There is no new language feature and no change to any API.
It is just saving some memory.
The only possible issue is changing dict repr() ordering,
but issue 13703 will do that anyway
Mark Shannon added the comment:
Raymond Hettinger wrote:
> Raymond Hettinger added the comment:
>
> Changing dictionaries is a big deal. You're changing many pieces at once
> (not a good idea) including changing tunable parameters that are well-studied
> (I spent a mon
Changes by Mark Shannon :
--
hgrepos: -109
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Mark Shannon :
--
hgrepos: +112
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24453/a9138aba7896.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24360/6a21f3b35e20.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bug
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24453/a9138aba7896.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bug
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24454/1f703b2607af.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Mark Shannon added the comment:
Antoine Pitrou wrote:
> Antoine Pitrou added the comment:
>
> Looking at your latest patch, I worry about "any deletion
> +(including pop & popitem) causes a split table to become a combined table".
> Why wouldn't you use a
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24454/1f703b2607af.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bug
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24455/bc286099ce9a.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24455/bc286099ce9a.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bug
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24456/20702d1acf17.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
New submission from Mark Shannon :
The f_yieldfrom field should not be visible at Python level, it is an internal
implementation detail.
Patch attached.
--
files: remove_f_yieldfrom.patch
keywords: patch
messages: 152895
nosy: Mark.Shannon
priority: normal
severity: normal
status
Mark Shannon added the comment:
Failure occurs in test_pprint which is covered by issue 13907
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Mark Shannon :
Added file: http://bugs.python.org/file24465/e50db1b7ad7b.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bugs-list m
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24456/20702d1acf17.diff
___
Python tracker
<http://bugs.python.org/issue13903>
___
___
Python-bug
Mark Shannon added the comment:
This issue was too broad. The new patch is focussed on sys.exc_info.
All hints of coroutines have been removed and f_yieldfrom is untouched.
New patch reduces code by 65 lines and does not conflict with issue 13607.
--
title: Move fields relevant to
Changes by Mark Shannon :
Removed file: http://bugs.python.org/file24350/coro.patch
___
Python tracker
<http://bugs.python.org/issue13897>
___
___
Python-bugs-list mailin
Mark Shannon added the comment:
Why do the codes used internally by ceval have to be the same as those made
public?
Have you considered returning the exit code directly, rather than
adding another field to frameobject?
yieldfrom can be handled in a similar way to yield by returning the
901 - 1000 of 1219 matches
Mail list logo