[Python-Dev] Heap allocate type structs in native extension modules?

2017-12-26 Thread Hugh Fisher
I have a Python program which generates the boilerplate code for native extension modules from a Python source definition. (http://bitbucket.org/hugh_fisher/fullofeels if interested.) The examples in the Python doco and the "Python Essential Reference" book all use a statically declared PyTypeObje

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-26 Thread Benjamin Peterson
I imagine Cython already takes care of this? On Tue, Dec 26, 2017, at 02:16, Hugh Fisher wrote: > I have a Python program which generates the boilerplate code for > native extension modules from a Python source definition. > (http://bitbucket.org/hugh_fisher/fullofeels if interested.) > > The exa

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-28 Thread Erik Bray
On Tue, Dec 26, 2017 at 3:00 PM, Benjamin Peterson wrote: > I imagine Cython already takes care of this? This appears to have a distinct purpose, albeit not unrelated to Cython. The OP's program would generate boilerplate C code for extension types the rest of which would perhaps be implemented

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-28 Thread Benjamin Peterson
On Thu, Dec 28, 2017, at 03:29, Erik Bray wrote: > On Tue, Dec 26, 2017 at 3:00 PM, Benjamin Peterson > wrote: > > I imagine Cython already takes care of this? > > This appears to have a distinct purpose, albeit not unrelated to > Cython. The OP's program would generate boilerplate C code for

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-29 Thread Serhiy Storchaka
26.12.17 12:16, Hugh Fisher пише: I have a Python program which generates the boilerplate code for native extension modules from a Python source definition. (http://bitbucket.org/hugh_fisher/fullofeels if interested.) The examples in the Python doco and the "Python Essential Reference" book all

Re: [Python-Dev] Heap allocate type structs in native extension modules?

2017-12-29 Thread Hugh Fisher
> Date: Fri, 29 Dec 2017 11:25:14 +0200 > From: Serhiy Storchaka > To: python-dev@python.org > Subject: Re: [Python-Dev] Heap allocate type structs in native > extension modules? [ munch ] > Yes, you can create heap types by using PyType_FromSpecWithBases(). > >