[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-03-13 Thread Irit Katriel


Irit Katriel  added the comment:

We have agreed on python-dev [1] that the cpython changes will not be reverted, 
and the issue will be fixed in cython. So I am closing this again.

[1] 
https://mail.python.org/archives/list/python-...@python.org/message/BHIQL4P6F7OPMCAP6U24XEZUPQKI62UT/

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-03-03 Thread STINNER Victor


STINNER Victor  added the comment:

lxml does crash on the current Cython 0.29.x development branch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread da-woods


da-woods  added the comment:

Just a quick comment on Cython and these changes:

Cython 0.29 can build itself on Python 3.11a4 with 
`CFLAGS="-DCYTHON_FAST_THREAD_STATE=0 -DCYTHON_USE_EXC_INFO_STACK=0" python3.11 
setup.py build_ext`.

I think there's some coroutine code left that isn't fixed by those flags, but a 
large chunk of Cython libraries won't use coroutines and so will work fine with 
these flags. Hopefully that unblocks some stuff for you.

--
nosy: +da-woods

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

> GH-30531 proposes adding PyErr_GetActiveException() function which has no 
> parameter, but Cython __Pyx_PyErr_GetTopmostException() has a tstate 
> parameter.


I've now updated it to follow the pattern of other functions, where the is a 
private function that takes tstate and the public function calls it.

So it adds in Include/pyerrors.h 

PyAPI_FUNC(PyObject*) PyErr_GetActiveException(void);
PyAPI_FUNC(void) PyErr_SetActiveException(PyObject *);

and in Include/cpython/pyerrors.h

PyAPI_FUNC(PyObject*) _PyErr_GetActiveException(PyThreadState *);
PyAPI_FUNC(void) _PyErr_SetActiveException(PyThreadState *, PyObject *);

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

This is a backport of @scoder's patch to 0.29.x. (I don't know if this is 
helpful).

https://github.com/cython/cython/compare/master...iritkatriel:exc_info?expand=1

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

> __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)

Python provides a *private* _PyErr_GetTopmostException(tstate) function, but 
Cython reimplements its own function. I'm not sure why.

GH-30531 proposes adding PyErr_GetActiveException() function which has no 
parameter, but Cython __Pyx_PyErr_GetTopmostException() has a tstate parameter.

Simplified example numpy/random/_mt19937.c code:

static CYTHON_INLINE void
__Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type,
 PyObject **value, PyObject **tb)
{
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
*type = exc_info->exc_type;
*value = exc_info->exc_value;
*tb = exc_info->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
}

static CYTHON_INLINE void
__Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type,
  PyObject *value, PyObject *tb)
{
PyObject *tmp_type, *tmp_value, *tmp_tb;
_PyErr_StackItem *exc_info = tstate->exc_info;
tmp_type = exc_info->exc_type;
tmp_value = exc_info->exc_value;
tmp_tb = exc_info->exc_traceback;
exc_info->exc_type = type;
exc_info->exc_value = value;
exc_info->exc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}

Cython saves/restores the current exception of tstate. Maybe we need to provide 
a high-level API for that as well?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Time to insist on directly communicating with the Cython team (esp. @scoder) 
and broker some kind of compromise.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

If this is still the position of cython maintainers:

https://github.com/cython/cython/issues/4581#issuecomment-1016503683

then I will need to revert the change until 3.12.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

That commit has significant changes in ceval.c and compile.c. They don't need 
to be reverted to unbreak cython.  I'm working on a PR for a simpler change.

Have you tried with CYTHON_USE_EXC_INFO_STACK undefined?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

Irit Katriel:
> Reverting the whole thing would include big changes in compile.c and ceval.c, 
> so I'd rather avoid that if we can.

It was a good idea to split changes of this issue into multiple commits :-) I'm 
only proposing to revert the one which introduces the C API incompatible 
changes: the commit 396b58345f81d4c8c5a52546d2288e666a1b9b8b "bpo-45711: Remove 
type and traceback from exc_info (GH-30122)".

Maybe Cython can be quickly updated, but the situation seems to be complicated 
:-( https://github.com/cython/cython/issues/4500

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

I commented the Cython issue:
https://github.com/cython/cython/issues/4500#issuecomment-1026949365

I also opened a discussion on python-dev: "Please update Cython before 
introcuding C API incompatible changes in Python".
https://mail.python.org/archives/list/python-...@python.org/thread/RS2C53LDZPXHRR2VCY2G2YSPDVA4LNQU/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

> In Cython, the issue is tracked as: 
> https://github.com/cython/cython/issues/4500

I don't understand the Cython status. The code was updated in the master branch:

* https://github.com/cython/cython/pull/4584
* 
https://github.com/cython/cython/commit/776957022d062ed24edea192b719720118ee3576

https://github.com/cython/cython/issues/4500 was closed even if the change was 
not backported to 0.29.x.

I understand that there is no released Cython 0.29.x version compatible with 
this change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

Does unsetting CYTHON_USE_EXC_INFO_STACK still work?



#if CYTHON_USE_EXC_INFO_STACK
// See  https://bugs.python.org/issue25612
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
// Minimal replacement struct for Py<3.7, without the Py3.7 exception state 
stack.
typedef struct {
PyObject *exc_type;
PyObject *exc_value;
PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

I can probably just put back the two fields in _PyErr_StackItem and make sure 
they get updated when exc_value is set. 

Reverting the whole thing would include big changes in compile.c and ceval.c, 
so I'd rather avoid that if we can.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to revert the change until Cython and numpy are ready for 
it?

> bpo-45711: Remove type and traceback from exc_info (GH-30122)

This change broke numpy which uses C code generated by Cython for coroutines in 
numpy/random/_mt19937.c (file generated from numpy/random/_mt19937.pyx).

Example of Cython code which no fails with a compiler error since 
exc_info->exc_type has been removed:

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
_PyErr_StackItem *exc_info = tstate->exc_info;
while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
   exc_info->previous_item != NULL)
{
exc_info = exc_info->previous_item;
}
return exc_info;
}
#endif

I propose this plan:

* (1) Revert this specific change
* (2) Wait until a change is merged in Cython 0.29.x
* (3) Wait until a new Cython 0.29.x version is released
* (4) Wait until numpy is released with regenerated code compatible with this 
change
* (5) Apply again the change

It should increase the number of packages when Python 3.11 will be released.

In Cython, the issue is tracked as: https://github.com/cython/cython/issues/4500

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-24 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 80e1def9ded2a1d017410394e50c88aa39135029 by Irit Katriel in 
branch 'main':
bpo-45711: move whatsnew entries which are incorrectly listed under New 
Features (GH-30849)
https://github.com/python/cpython/commit/80e1def9ded2a1d017410394e50c88aa39135029


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-24 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +29031
pull_request: https://github.com/python/cpython/pull/30849

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28539
pull_request: https://github.com/python/cpython/pull/30289

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests:  -28217

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests:  -28193

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-01 Thread Irit Katriel


Irit Katriel  added the comment:

This is done, there will be more cleanups that this enables but they can have 
their own issues.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-01-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests:  -28503

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-29 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28503
pull_request: https://github.com/python/cpython/pull/30289

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-17 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 396b58345f81d4c8c5a52546d2288e666a1b9b8b by Irit Katriel in 
branch 'main':
bpo-45711: Remove type and traceback from exc_info (GH-30122)
https://github.com/python/cpython/commit/396b58345f81d4c8c5a52546d2288e666a1b9b8b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-17 Thread Stefan Behnel


Stefan Behnel  added the comment:

FYI, we track the Cython side of this in
https://github.com/cython/cython/issues/4500

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-17 Thread Stefan Behnel


Change by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-15 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28341
pull_request: https://github.com/python/cpython/pull/30122

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-08 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28217
pull_request: https://github.com/python/cpython/pull/29994

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-08 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 2109f7880b65755329a877da3a7f8a362de07350 by Irit Katriel in 
branch 'main':
bpo-45711: Remove unnecessary normalization of exc_info (GH-29922)
https://github.com/python/cpython/commit/2109f7880b65755329a877da3a7f8a362de07350


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28193
pull_request: https://github.com/python/cpython/pull/29968

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-05 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28146
pull_request: https://github.com/python/cpython/pull/29922

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 2ff758bd1a144ee712e96ae1db91f476c3b252bb by Irit Katriel in 
branch 'main':
bpo-45711: [asyncio] Normalize exceptions immediately after Fetch, before they 
are stored as StackItem, which should be normalized (GH-29890)
https://github.com/python/cpython/commit/2ff758bd1a144ee712e96ae1db91f476c3b252bb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-02 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28114
pull_request: https://github.com/python/cpython/pull/29890

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-30 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8a45ca542a65ea27e7acaa44a4c833a27830e796 by Irit Katriel in 
branch 'main':
bpo-45711: Change exc_info related APIs to derive type and traceback from the 
exception instance (GH-29780)
https://github.com/python/cpython/commit/8a45ca542a65ea27e7acaa44a4c833a27830e796


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28017
pull_request: https://github.com/python/cpython/pull/29780

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:

Following the analysis/discussion on 
https://github.com/faster-cpython/ideas/issues/106:

* exc_info is always normalized, so we actually will never need to create a 
tuple of these three values (exc_curinfo, the exception raised but not yet 
caught can be unnormalized, but it is not pushed/popped on the stack). 

* We will reduce the interpreter's exc_info representation to just the 
exception instance.

* There are two APIs that are impacted, both in non-documented edge cases:

1. sys.exc_info()[2] can currently be different from 
sys.exc_info()[1].__traceback__ because changes to the latter (while an except 
clause is executing) don't show up in the former. This is arguably a bug, we 
will change it so that the type and traceback are always consistent with the 
exception.

2. PyErr_SetExcInfo does no arg checking, and will set exc_info to an 
inconsistent triplet if you ask it to. However, the exc_value arg must be an 
exception instance so the only thing you can do is pass in nonsensical args 
where the type/traceback do not match the exception. This function's purpose is 
to save/restore exc_info. We will make it ignore the type and traceback and 
document that change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset c456dfafe9f9f6614fbcf2213a93707f0e101f4e by Irit Katriel in 
branch 'main':
bpo-45711: use exc_value instead of exc_type to determine if exc_info is valid. 
Add more assertions. (GH-29627)
https://github.com/python/cpython/commit/c456dfafe9f9f6614fbcf2213a93707f0e101f4e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-18 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +27859
pull_request: https://github.com/python/cpython/pull/29627

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-12 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d by Irit Katriel in 
branch 'main':
bpo-45711: assert that the type of exc_info is redundant (GH-29518)
https://github.com/python/cpython/commit/de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-12 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8f1b71de731dda668aede7c9b34d0ad7afb8f6a8 by Brandt Bucher in 
branch 'main':
bpo-45711: Re-bump the magic number and update doc (GH-29528)
https://github.com/python/cpython/commit/8f1b71de731dda668aede7c9b34d0ad7afb8f6a8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-11 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher
nosy_count: 4.0 -> 5.0
pull_requests: +27778
pull_request: https://github.com/python/cpython/pull/29528

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-10 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +27770
pull_request: https://github.com/python/cpython/pull/29518

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-10 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4cdeee5978ee3f8ea7fe95172ae04d866cd88177 by Irit Katriel in 
branch 'main':
bpo-45711: remove unnecessary DUP_TOP and POP in exception handling (GH-29495)
https://github.com/python/cpython/commit/4cdeee5978ee3f8ea7fe95172ae04d866cd88177


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-10 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 05fbd60147456d77a7aecf2986c5bde5872f by Irit Katriel in 
branch 'main':
bpo-45711: Use _PyErr_ClearExcState instead of setting only exc_value to NULL 
(GH-29404)
https://github.com/python/cpython/commit/05fbd60147456d77a7aecf2986c5bde5872f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-09 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +27745
pull_request: https://github.com/python/cpython/pull/29495

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-06 Thread Irit Katriel

Irit Katriel  added the comment:

Initially not, neither in python nor in the c api.

It would be nice to replace PyErr_Fetch/Restore by a version that takes just an 
exception but that’s a long deprecation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Would there be any change at the Python level?

--
nosy: +terry.reedy
type:  -> performance

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-04 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
pull_requests: +27660
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29404

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-04 Thread Irit Katriel


New submission from Irit Katriel :

Exceptions are represented in the interpreter as (type, val, tb) triplets which 
most of the time contain redundant information (the type is the type of val and 
the tb is also on the exception). This complicates the code and is inefficient 
as opcodes that manage exceptions push and pop 3 items for each exception. 

We will change the internal representation to be (1) just the exception value 
if it is normalised and (2) a tuple of the 3 values for the uncommon case where 
they are all needed.

See also https://github.com/faster-cpython/ideas/issues/106.

--
components: Interpreter Core
messages: 405681
nosy: Mark.Shannon, gvanrossum, iritkatriel
priority: normal
severity: normal
status: open
title: Simplify the interpreter's (type, val, tb) exception representation
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com