[PATCHES] Build pytalloc for two Python versions at once, port to py3

Jelmer Vernooij jelmer at samba.org
Thu Mar 12 07:09:57 MDT 2015


On Thu, Mar 12, 2015 at 12:08:48PM +0100, Petr Viktorin wrote:
> On 03/05/2015 10:08 PM, Andrew Bartlett wrote:
> >On Wed, 2015-03-04 at 15:53 +0100, Jelmer Vernooij wrote:
> >>On Wed, Mar 04, 2015 at 11:18:08AM +1300, Andrew Bartlett wrote:
> >>>On Tue, 2015-03-03 at 22:09 +0100, Jelmer Vernooij wrote:
> >>>>On Mon, Mar 02, 2015 at 12:09:25PM +0100, Petr Viktorin wrote:
> >Petr,
> >
> >The reason I'm being so awkward is that I don't like any of the options.
> >  - waiting forever means we:
> >   - push aside your valuable contributions
> >   - may never make the move
> 
> I don't think the second point is true; you'd be forced to make the move
> eventually, most likely when Python 2 support ends in 5 years. It's good not
> to rush things, but waiting forever is hardly an option -- it would just
> make us rush things later.

If we move later, it saves us from a couple of years of juggling support
for two different Python versions. In fact, if we move late enough, we might
be able to just drop Python2 support altogether and just port to Python3 rather
than supporting both versions.

> >  - waiting for things to improve:
> >   - you suggest is foolish, there is no indication that the python community will
> >   - and we don't know that someone else will be keen to do the work in the future
> 
> Also, there's a non-trivial chance that my work on Samba could drive these
> improvements.
> It's been suggested a CPython list that I write a porting guide for C code.
> I'm quite tempted to share what I write for Samba.

Thanks! Upstream improvements to make it easier to support both versions
would be great. 

I think defines to make it easier to compile 2.6 C code with Python3 belong
in an upstream header (perhaps hidden behind and #ifdef _COMPAT_PYTHON26 or
with a deprecation warning), rather than in every Python projects' source
tree.

> >   - risks restricting developers to the cumbersome common subset - yet another language, essentially
> 
> That mostly applies to Python source. In the C extensions, alternatives to
> the removed things have usually been ported to Python 2.6, so not even an
> #ifdef is necesary. The main problem is deciding between bytes and unicode.

There are already quite a number of ifdefs in the current set of patches, and
this is a fairly simple module..

Cheers,

Jelmer


More information about the samba-technical mailing list