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

Andrew Bartlett abartlet at samba.org
Thu Mar 5 14:08:56 MST 2015


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:

> > >  * It shouldn't clutter the code with lots of compatibility wrappers
> > >    that make the code unreadable.
> > 
> > I'm sorry to hear earlier in the thread that there are no efforts to
> > have a compatibility API for the C interface, because it seems that in
> > Samba, we already do have a good separation between bytes and unicode,
> > because we care to be null-termination safe.  
> > 
> > That is, length-limited strings are byte arrays, null terminated strings
> > are utf8 strings.  Within those rules, and within Jelmer's stipulation
> > above, I would like to see a library that implements the Python3 C API
> > in terms of python2.  Then we could port Samba to that, one module at a
> > time.  It wouldn't make the code unreadable, because it would be the
> > Python3 API.  I might permit a small number of #ifdefs, but these too
> > make the code unreadable. 
> FWIW I am very skeptical that such a (python3 on top of python2 API) wrapper
> would be possible, especially in a way that makes it less painful than #ifdefs.
> 
> It might have been possible if the Python3 API had been designed with such
> a compatibility layer in mind, but it hasn't.

Indeed, I may be requesting a monster.  

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
 - 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
 - moving now:
  - risks years of migration wrappers/ifdef etc
  - risks restricting developers to the cumbersome common subset - yet another language, essentially
  - imposes a burden on the already very small part of the Samba team with an interest in maintaining the python code

I do really appreciate your efforts, and in particular your efforts to
add tests.  That will help improve confidence.  If we can do that, and
follow the incremental development principals we use elsewhere, then I
think we have a small hope of success.

I do realise we will at some point need to do a large pass over the
code, and I honestly don't look forward to it.  

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list