Shall I worry about python2/3 compatibility when using library?

Stone Zhong stone.zhong at gmail.com
Fri Aug 31 01:33:49 EDT 2018


On Thursday, August 30, 2018 at 10:19:34 PM UTC-7, Terry Reedy wrote:
> On 8/30/2018 10:27 PM, Stone Zhong wrote:
> > Hi there,
> > 
> > I think the fact is:
> > - There are still considerable amount of people still using python2
> > - Python2 user will eventually upgrade to python3
> > 
> > So any library not written in a compatible way will either break now for python2 user, or will break in the future for python3 user. So I suppose all library developer are writing compatible code, is that a fair assumption?
> 
> No.  Many people write new libraries only for recent version of Python 
> 3.  Many people who have written Python 2 and 3 compatible libraries, or 
> Python 2 and Python 3 versions of of their library, have or will drop 
> Python 2 support for enhancements and even bugfixes for their library.
> 
> That said, some people will continue to use existing python 2 code for a 
> decade or more.
> 
> -- 
> Terry Jan Reedy

Thanks for the reply Terry. Got it.

So some people main separate libraries for python2 and python3 (although this way it may have extra cost), and may eventually drop support for python2 lib or may not even have library for python2.

Thanks,
Stone



More information about the Python-list mailing list