[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-05 Thread Eric Snow
On Wed, Jun 3, 2020 at 7:12 AM Mark Shannon wrote: > The size of the C API, as measured by `git grep PyAPI_FUNC | wc -l` has > been steadily increasing over the last few releases. > > 3.5 1237 > 3.6 1304 > 3.7 1408 > 3.8 1478 > 3.9 1518 > > > For reference the 2.7 branch has

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-05 Thread Mark Shannon
On 03/06/2020 8:49 pm, Pablo Galindo Salgado wrote: Just some comments on the GC stuff as I added them myself. Shouldn't GC track *all* objects? No, extension types need to opt-in to the garbage collector and if so, implement the interface. When you say "GC" I think you mean the backup

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-04 Thread Barry Scott
> On 4 Jun 2020, at 16:34, Victor Stinner wrote: > > Le jeu. 4 juin 2020 à 00:14, Nathaniel Smith a écrit : >> On Wed, Jun 3, 2020 at 2:10 PM Victor Stinner wrote: >>> For the short term, my plan is to make structure opaque in the limited >>> C API, before breaking more stuff in the public C

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-04 Thread Victor Stinner
Le jeu. 4 juin 2020 à 00:14, Nathaniel Smith a écrit : > On Wed, Jun 3, 2020 at 2:10 PM Victor Stinner wrote: > > For the short term, my plan is to make structure opaque in the limited > > C API, before breaking more stuff in the public C API :-) > > But you're also breaking the public C API: >

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-04 Thread Chris Jerdonek
On Wed, Jun 3, 2020 at 6:09 AM Mark Shannon wrote: > Also, can we remove all the new API functions added in 3.9 before the > release and it is too late? > I think it would be helpful to open an issue that lists the 40 new functions, so people could more easily review them before 3.9 is

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Gregory P. Smith
On Wed, Jun 3, 2020 at 2:13 PM Victor Stinner wrote: > Le mer. 3 juin 2020 à 19:17, Mark Shannon a écrit : > > > I also *added* a bunch of *new* "getter" or "setter" functions to the > > > public C API for my project of hiding implementation details, like > > > making structures opaque: > > >

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Nathaniel Smith
On Wed, Jun 3, 2020 at 2:10 PM Victor Stinner wrote: > For the short term, my plan is to make structure opaque in the limited > C API, before breaking more stuff in the public C API :-) But you're also breaking the public C API: https://github.com/MagicStack/immutables/issues/46

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Victor Stinner
Le mer. 3 juin 2020 à 19:17, Mark Shannon a écrit : > > I also *added* a bunch of *new* "getter" or "setter" functions to the > > public C API for my project of hiding implementation details, like > > making structures opaque: > > https://docs.python.org/dev/whatsnew/3.9.html#id1 > > Adding

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Pablo Galindo Salgado
Just some comments on the GC stuff as I added them myself. > Shouldn't GC track *all* objects? No, extension types need to opt-in to the garbage collector and if so, implement the interface. > Even if it were named PyObject_Cycle_GC_IsTracked() it would be exposing internal implementation

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Mark Shannon
Hi Victor, On 03/06/2020 2:42 pm, Victor Stinner wrote: Hi, In Python 3.9, I *removed* dozens of functions from the *public* C API, or moved them to the "internal" C API: https://docs.python.org/dev/whatsnew/3.9.html#id3 For a few internal C API, I replaced PyAPI_FUNC() with extern to ensure

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Simon Cross
Maybe we can have a two-for-one special? You can add a new function to the API if you deprecate two. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

[Python-Dev] Re: Can we stop adding to the C API, please?

2020-06-03 Thread Victor Stinner
Hi, In Python 3.9, I *removed* dozens of functions from the *public* C API, or moved them to the "internal" C API: https://docs.python.org/dev/whatsnew/3.9.html#id3 For a few internal C API, I replaced PyAPI_FUNC() with extern to ensure that they cannot be used outside CPython code base: Python