[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Victor Stinner
If creating a fake frame is a common use case, we can maybe write a public C API for that. For example, I saw parser injecting frames to show the file name and line number of the parsed file in the traceback. Victor On Wed, Sep 1, 2021 at 4:07 AM Stefan Behnel wrote: > > Guido van Rossum schrieb

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Pablo Galindo Salgado
> If creating a fake frame is a common use case, we can maybe write a public C API for that. I don't think we should think on those terms. We certainly don't want to be on a case where yet again we cannot change the internals because we have an official C-API exposed. > For example, I saw parser

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Guido van Rossum
(context) > Guido van Rossum schrieb am 13.08.21 um 19:24: > > In 3.11 we're changing a lot of details about code objects. Part of this > is > > the "Faster CPython" work, part of it is other things (e.g. PEP 657 -- > Fine > > Grained Error Locations in Tracebacks). > > > > As a result, the set of

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Guido van Rossum
I apologize, I keep making the same mistake. The PyCode_New[WithPosArgs] functions are *not* in the stable ABI or in the limited API, so there's no need to petition the SC, nor do I need Petr's approval. We may be bound by backwards compatibility for the *cpython* API, but I think that if Cython

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Victor Stinner
I saw Python projects injecting fake frames for XML and JSON parsers, maybe also configuration file (.ini?) parsers. So text files which have line numbers ;-) On Wed, Sep 1, 2021 at 7:33 PM Pablo Galindo Salgado wrote: > I don't think we should think on those terms. We certainly don't want to be

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-01 Thread Nick Coghlan
On Tue, 31 Aug 2021, 2:52 am Brett Cannon, wrote: > > On Sun, Aug 29, 2021 at 2:01 PM Serhiy Storchaka > wrote: > >> >> > So my question is whether the discrepancy between what `async for` >> > expects and what `aiter()` expects on purpose? >> > https://bugs.python.org/issue31861

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Nick Coghlan
On Thu, 2 Sep 2021, 7:08 am Victor Stinner, wrote: > I saw Python projects injecting fake frames for XML and JSON parsers, > maybe also configuration file (.ini?) parsers. So text files which > have line numbers ;-) > > On Wed, Sep 1, 2021 at 7:33 PM Pablo Galindo Salgado > wrote: > > I don't th

[Python-Dev] Re: PEP-535 (Rich comparison chaining) Discussion?

2021-09-01 Thread Nick Coghlan
On Wed, 1 Sep 2021, 7:18 am Senthil Kumaran, wrote: > On Tue, Aug 31, 2021 at 8:57 AM Angus Hollands wrote: > > >> Should look more like >> ```python >> x = np.array(...) >> y = x[2 < x < 8] >> ``` >> Is there any interest in pushing this PEP along? >> > > My personal opinion is, it is worth dis

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Greg Ewing
On 2/09/21 4:46 am, Victor Stinner wrote: If creating a fake frame is a common use case, we can maybe write a public C API for that. For example, I saw parser injecting frames to show the file name and line number of the parsed file in the traceback. The way I would like to see this addressed i