(original) (raw)
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 examples in the Python doco and the "Python Essential Reference"
> book all use a statically declared PyTypeObject struct and
> PyType\_Ready in the module init func, so I'm doing the same. Then
> Python 3.5 added a check for statically allocated types inheriting
> from heap types, which broke a couple of my classes. And now I'm
> trying to add a \_\_dict\_\_ to native classes so end users can add their
> own attributes, and this is turning out to be painful with static
> PyTypeObject structs
>
> Would it be better to use dynamically allocated type structs in native modules?
>
> --
>
> cheers,
> Hugh Fisher
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/benjamin%40python.org