[Python-ideas] Re: Expose _PyGC_generation0 for allowing internal use directly from a CPython extension

2019-10-21 Thread Victor Stinner
He opened https://bugs.python.org/issue38542

It seems like the issue is specific to Python 2.7. Well, see the issue
for more details ;-)

Victor
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/OUOKSEJOX4VLASPJRQ5I3IUIU4C44C7N/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Re: Expose _PyGC_generation0 for allowing internal use directly from a CPython extension

2019-10-21 Thread GAUDRY Eloi
ok, I will.
thanks

éloi

From: Guido van Rossum 
Sent: Friday, October 18, 2019 20:26
To: GAUDRY Eloi 
Cc: python-ideas@python.org 
Subject: Re: [Python-ideas] Expose _PyGC_generation0 for allowing internal use 
directly from a CPython extension

This email is not from Hexagon’s Office 365 instance. Please be careful while 
clicking links, opening attachments, or replying to this email.

This looks like an issue for 
bugs.python.org.
 After opening a bug there you could also try to fix this yourself and submit a 
Pull Request (see the Python devguide).

On Fri, Oct 18, 2019 at 3:10 AM GAUDRY Eloi 
mailto:eloi.gau...@fft.be>> wrote:
Hi

I would like to be able to get an handle on PyGC_Head*_PyGC_generation0 from a 
CPython extension.
This is possible when building Python on a Posix host, but not on Windows 
because of a missing PyAPI_DATA wrapping of the said object in the objimpl.h 
header.

Having the possibility to inspect the PyGC_Head here can be very useful when 
customizing the way a garbage-collectable object created from CPython extension 
would be cleaned/inspected, etc.

Any chance this patch could be added to get the same capabilities on Windows 
and Posix platforms ?

Thanks for your feedback,
Eloi



Index: Include/objimpl.h
===
--- Include/objimpl.h (revision 118072)
+++ Include/objimpl.h (working copy)
@@ -258,7 +258,7 @@
 double dummy;  /* force worst-case alignment */
 } PyGC_Head;

-extern PyGC_Head *_PyGC_generation0;
+PyAPI_DATA(PyGC_Head*) _PyGC_generation0;

 #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)

___
Python-ideas mailing list -- 
python-ideas@python.org
To unsubscribe send an email to 
python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7FC2NHAOMKBHONFTUKMAHO5F56UU5UUD/
Code of Conduct: 
http://python.org/psf/codeofconduct/


--
--Guido van Rossum 
(python.org/~guido)
Pronouns: he/him (why is my pronoun 
here?)
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/W34GXNK3CIK443E2R5MPECHGWSYCMWI4/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Re: Expose _PyGC_generation0 for allowing internal use directly from a CPython extension

2019-10-18 Thread Andrew Svetlov
I suspect this proposal contradicts with CPython movement to close as
many implementation details as possible.

On Fri, Oct 18, 2019 at 9:28 PM Guido van Rossum  wrote:
>
> This looks like an issue for bugs.python.org. After opening a bug there you 
> could also try to fix this yourself and submit a Pull Request (see the Python 
> devguide).
>
> On Fri, Oct 18, 2019 at 3:10 AM GAUDRY Eloi  wrote:
>>
>> Hi
>>
>> I would like to be able to get an handle on PyGC_Head*_PyGC_generation0 from 
>> a CPython extension.
>> This is possible when building Python on a Posix host, but not on Windows 
>> because of a missing PyAPI_DATA wrapping of the said object in the objimpl.h 
>> header.
>>
>> Having the possibility to inspect the PyGC_Head here can be very useful when 
>> customizing the way a garbage-collectable object created from CPython 
>> extension would be cleaned/inspected, etc.
>>
>> Any chance this patch could be added to get the same capabilities on Windows 
>> and Posix platforms ?
>>
>> Thanks for your feedback,
>> Eloi
>>
>>
>>
>> Index: Include/objimpl.h
>> ===
>> --- Include/objimpl.h (revision 118072)
>> +++ Include/objimpl.h (working copy)
>> @@ -258,7 +258,7 @@
>>  double dummy;  /* force worst-case alignment */
>>  } PyGC_Head;
>>
>> -extern PyGC_Head *_PyGC_generation0;
>> +PyAPI_DATA(PyGC_Head*) _PyGC_generation0;
>>
>>  #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
>>
>> ___
>> Python-ideas mailing list -- python-ideas@python.org
>> To unsubscribe send an email to python-ideas-le...@python.org
>> https://mail.python.org/mailman3/lists/python-ideas.python.org/
>> Message archived at 
>> https://mail.python.org/archives/list/python-ideas@python.org/message/7FC2NHAOMKBHONFTUKMAHO5F56UU5UUD/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
> Pronouns: he/him (why is my pronoun here?)
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-ideas@python.org/message/OOFEW4ZBKBOF6VEXDCEXSR6HIL7PGAMX/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Thanks,
Andrew Svetlov
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/6VFDIAINEPKU2UDHCYAQ5OAHNAI7TNZK/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Re: Expose _PyGC_generation0 for allowing internal use directly from a CPython extension

2019-10-18 Thread Guido van Rossum
This looks like an issue for bugs.python.org. After opening a bug there you
could also try to fix this yourself and submit a Pull Request (see the
Python devguide).

On Fri, Oct 18, 2019 at 3:10 AM GAUDRY Eloi  wrote:

> Hi
>
> I would like to be able to get an handle on PyGC_Head*_PyGC_generation0
> from a CPython extension.
> This is possible when building Python on a Posix host, but not on Windows
> because of a missing PyAPI_DATA wrapping of the said object in the
> objimpl.h header.
>
> Having the possibility to inspect the PyGC_Head here can be very useful
> when customizing the way a garbage-collectable object created from CPython
> extension would be cleaned/inspected, etc.
>
> Any chance this patch could be added to get the same capabilities on
> Windows and Posix platforms ?
>
> Thanks for your feedback,
> Eloi
>
>
>
> Index: Include/objimpl.h
> ===
> --- Include/objimpl.h (revision 118072)
> +++ Include/objimpl.h (working copy)
> @@ -258,7 +258,7 @@
>  double dummy;  /* force worst-case alignment */
>  } PyGC_Head;
>
> -extern PyGC_Head *_PyGC_generation0;
> +PyAPI_DATA(PyGC_Head*) _PyGC_generation0;
>
>  #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
>
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/7FC2NHAOMKBHONFTUKMAHO5F56UU5UUD/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/OOFEW4ZBKBOF6VEXDCEXSR6HIL7PGAMX/
Code of Conduct: http://python.org/psf/codeofconduct/