On 23 August 2017 at 00:09, stackless <tis...@stackless.com> wrote:
> Hi again,
>
> I am trying to support the limited Api (PEP 384) for PySide. Fortunately,
> everything worked out of the box, just the datetime module gives me
> a problem. Inspection showed that datetime is completely removed
> when the limitation is set.
>
> Can somebody enlighten me why that needs to be so?

The main problem is that "datetime.h" defines several C structs that
we wouldn't want to add to the stable ABI, and nobody has previously
worked through details of the interface to see which parts of it could
still be used even if those structs were made opaque, and the macros
relying on them were switched to being functions instead.

There are almost certainly pieces of it that *could* be usefully
exposed, though.

> And how should I use datetime, instead: Fish the functions out of
> the dynamically imported datetime module?

Yep, going via the Python level API rather than directly to the C API
is the default answer, as that inherently hides any struct layout
details behind PyObject*.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
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/archive%40mail-archive.com

Reply via email to