[PATCH] Python3 compatible modules - credentials, param, _glue

Stefan Metzmacher metze at samba.org
Thu Feb 9 14:55:35 UTC 2017


Hi Petr,

>> I've started a thread to have us move to just using PyCapsule by
>> requiring 2.7.  I think this is likely to get up, but we will know
>> soon.  This will kill a number of birds with one stone, so can you re-
>> work the patches to rely on PyCapsule?
> 
> Requiring 2.7 is two questions in one:
> - the minimum version for Samba
> - the minimum version for independent libraries like pytalloc
> 
> But thinking about this, I realized pytalloc can
> - export pytalloc_CObject_FromTallocPtr for Python 2
> - export pytalloc_PyCapsule_FromTallocPtr for Python 3 *and* 2.7
> 
> Then Samba could use only PyCapsule (if it doesn't need 2.6
> compatibility), while talloc maintains backwards compatibility.

Maybe to naive, but can't we somehow simulate PyCapsule on top of
CObject for 2.6?
And use PyCapsule everywhere in the code?

At least I seem to have thought about something like this (maybe the
reverse) here
https://git.samba.org/?p=samba.git;a=commitdiff;h=e0324c0cf7e7c363a579

+               ##
+               ## PyCapsule (starting with 2.7) vs. PyCObject (up to 3.2)
+               ##
+               ## As we need to support python 2.6, we can't use
PyCapsule yet.
+               ##
+               ## When we'll get support fpr Python3 we'll have to emulate
+               ## PyCObject using PyCapsule and convert these functions to
+               ## use PyCapsule.
+               ##

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170209/1f714ee2/signature.sig>


More information about the samba-technical mailing list