Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Nick Coghlan
On 14 July 2017 at 02:29, Brett Cannon wrote: > On Thu, 13 Jul 2017 at 09:12 Ronald Oussoren wrote: >> I don’t understand. Moving too functions instead of macros for some thing >> doesn’t really help with keeping the public API stable (for the non-stable >> ABI). > > > Sorry, I didn't specify whi

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Nick Coghlan
On 14 July 2017 at 01:35, Victor Stinner wrote: > 2017-07-13 15:21 GMT+02:00 Nick Coghlan : >> As far as I know, this isn't really why folks find the stable ABI hard >> to switch to. Rather, I believe it's because switching to the stable >> ABI means completely changing how you define classes to b

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Ronald Oussoren
> On 13 Jul 2017, at 13:46, Victor Stinner wrote: > > 2017-07-12 20:51 GMT+02:00 Brett Cannon : >> I also think the motivation doesn't have to be performance but simply >> cleaning up how we expose our C APIs to users as shown by the fact we have >> messed up the stable API by making it opt-out

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Brett Cannon
On Thu, 13 Jul 2017 at 09:12 Ronald Oussoren wrote: > On 12 Jul 2017, at 20:51, Brett Cannon wrote: > > > > On Wed, 12 Jul 2017 at 01:25 Ronald Oussoren > wrote: > >> >> > On 11 Jul 2017, at 12:19, Victor Stinner >> wrote: >> > [SNIP] > > > >> > Step 3: first pass of implementation detail remo

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Ronald Oussoren
> On 12 Jul 2017, at 20:51, Brett Cannon wrote: > > > > On Wed, 12 Jul 2017 at 01:25 Ronald Oussoren > wrote: > > > On 11 Jul 2017, at 12:19, Victor Stinner > > wrote: > > > > Hi, > > > > This is the first draft of a big (?) pr

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Victor Stinner
2017-07-13 15:21 GMT+02:00 Nick Coghlan : > As far as I know, this isn't really why folks find the stable ABI hard > to switch to. Rather, I believe it's because switching to the stable > ABI means completely changing how you define classes to be closer to > the way you define them from Python code

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Nick Coghlan
On 13 July 2017 at 21:46, Victor Stinner wrote: > 2017-07-12 20:51 GMT+02:00 Brett Cannon : >> I think Victor has long-term plans to try and hide the struct details at a >> higher-level and so that would make macros a bad thing. But ignoring the >> specific Py_INCREF/DECREF example, switching to f

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Victor Stinner
2017-07-12 20:51 GMT+02:00 Brett Cannon : > I also think the motivation doesn't have to be performance but simply > cleaning up how we expose our C APIs to users as shown by the fact we have > messed up the stable API by making it opt-out instead of opt-in. It's hard to sell a "cleanup" to users w

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-13 Thread Victor Stinner
2017-07-13 0:23 GMT+02:00 Stefan Behnel : > From a Cython perspective, it's (not great but) ok if these "implementation > details" were moved somewhere else, but it would be a problem if they > became entirely unavailable for external modules. Cython uses some of the > internals for performance rea

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-12 Thread Nick Coghlan
On 13 July 2017 at 08:23, Stefan Behnel wrote: > The general rule of thumb in Cython core development is that it's ok to > exploit internals as long as there is a generic fallback through some C-API > operations which can be used in other Python implementations. I'd be happy > if that continued to

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-12 Thread Stefan Behnel
Victor Stinner schrieb am 11.07.2017 um 12:19: > Split the ``Include/`` directory of CPython: > > * ``python`` API: ``Include/Python.h`` remains the default C API > * ``core`` API: ``Include/core/Python.h`` is a new C API designed for > building Python > * ``stable`` API: ``Include/stable/Python

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-12 Thread Brett Cannon
On Wed, 12 Jul 2017 at 01:25 Ronald Oussoren wrote: > > > On 11 Jul 2017, at 12:19, Victor Stinner > wrote: > > > > Hi, > > > > This is the first draft of a big (?) project to prepare CPython to be > > able to "modernize" its implementation. Proposed changes should allow > > to make CPython more

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-12 Thread Ronald Oussoren
> On 11 Jul 2017, at 12:19, Victor Stinner wrote: > > Hi, > > This is the first draft of a big (?) project to prepare CPython to be > able to "modernize" its implementation. Proposed changes should allow > to make CPython more efficient in the future. The optimizations > themself are out of the

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Terry Reedy
On 7/11/2017 11:30 PM, Nick Coghlan wrote: Commenting more on specific technical details rather than just tone this time :) On 11 July 2017 at 20:19, Victor Stinner wrote: Reference counting may be emulated in a future implementation for backward compatibility. One heavy user's experience

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Nick Coghlan
Commenting more on specific technical details rather than just tone this time :) On 11 July 2017 at 20:19, Victor Stinner wrote: > PEP: xxx > Title: Hide implementation details in the C API > Version: $Revision$ > Last-Modified: $Date$ > Author: Victor Stinner , > Status: Draft > Type: Standards

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Barry Scott
This is a great idea. The suggestions in your first draft would help clean up some of the uglier corners of the PyCXX code. I'd suggest that you might want to add at least 1 PyCXX based extension to your testing. PyCXX aims to expose all the C API as C++ classes. (I'm missing the class variable

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Eric Snow
On Tue, Jul 11, 2017 at 4:19 AM, Victor Stinner wrote: > Step 1: split Include/ into subdirectories > -- > > Split the ``Include/`` directory of CPython: > > * ``python`` API: ``Include/Python.h`` remains the default C API > * ``core`` API: ``Include/core/Py

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Victor Stinner
> Step 3: first pass of implementation detail removal > --- > > Modify the ``python`` API: > > * Add a new ``API`` subdirectory in the Python source code which will > "implement" the Python C API > * Replace macros with functions. The implementation

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Paul Moore
On 11 July 2017 at 11:19, Victor Stinner wrote: > XXX should we abandon the stable ABI? Never really used by anyone. Please don't. On Windows, embedding Python is a pain because a new version of Python requires a recompile (which isn't ideal for apps that just want to optionally allow Python scri

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Nick Coghlan
On 11 July 2017 at 20:19, Victor Stinner wrote: > Hi, > > This is the first draft of a big (?) project to prepare CPython to be > able to "modernize" its implementation. Proposed changes should allow > to make CPython more efficient in the future. The optimizations > themself are out of the scope

[Python-ideas] PEP: Hide implementation details in the C API

2017-07-11 Thread Victor Stinner
Hi, This is the first draft of a big (?) project to prepare CPython to be able to "modernize" its implementation. Proposed changes should allow to make CPython more efficient in the future. The optimizations themself are out of the scope of the PEP, but some examples are listed to explain why thes