
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? And how should I use datetime, instead: Fish the functions out of the dynamically imported datetime module? Thanks in advance - Chris Sent from my Ei4Steve

On 23 August 2017 at 00:09, stackless <tismer@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 | ncoghlan@gmail.com | Brisbane, Australia

Hi Nick, On 23.08.17 07:41, Nick Coghlan wrote:
On 23 August 2017 at 00:09, stackless <tismer@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*.
Thank you very much for the clarification. I think we can live with the Python interface for now. Now I'm sure that I'm going the way to go. Cheers -- Chris -- Christian Tismer :^) tismer@stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : https://github.com/PySide 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023
participants (3)
-
Christian Tismer
-
Nick Coghlan
-
stackless