[pythran] Re: Python 3 support?

  • From: Ian Ozsvald <ian@xxxxxxxxxxxxxx>
  • To: pythran <pythran@xxxxxxxxxxxxx>
  • Date: Thu, 6 Nov 2014 16:57:32 +0000

Hi Serge, Pierrick. I've been running some surveys the the PyDataLondon
meetup I co-organise (and via my blog), I get the impression that 25% of
data scientists are using Python 3.3 or 3.4 at present (vs 2.7 with
approximate 75%) at present and in the next 6 months (if people's answers
are to be trusted) it'll be more like 50%. I think the penetration of
Python 3.4 will depend heavily on sector:
web developers - if they have a big code base there's no compelling reason
to move to Python 3.4 if they have a large existing codebase
big corporates - very little reason to upgrade until Python 2.7 reaches
end-of-line for support
scientists (including me) - no reason to maintain Py2.7 research code
especially when starting new projects but could be using existing Py2.7
projects
natural language processing people (includes me) - unicode FTW! absolutely
no reason to stick to Python 2.7 if UnicodeDecodeError is ever encountered
academics - I don't really know...?

So the question might become - who is the dominant user of Pythran? Maybe
you should run a survey (e.g. surveymonkey makes it *really* easy), you can
collect 100 answers without paying. Put a survey on your homepage, mail it
around, stick it in reddit/r/python etc and ask about domains, whether they
use 2.7 or 3.4 now and what will they use in 1 year etc. If you get a feel
for the users, you might learn about your target userbase's needs.

I'm guessing your users are more likely to be researchers in university
with cpu-bound math problems, they're probably on 2.7. Personally I won't
use 2.7 unless there's an incredibly strong reason and my use-cases are
well satisfied using Python 3.4.

On that note - numba continues to improve and it runs on Py3.4 nicely and
Cython works great, so all new users to Python (by default they're likely
to use Python 3.4) will be looking at these tools.

Re. the switch to Python 3.4 - for complete compatibility you'd have to
update the ast *but* I wonder if you can get away with a subset that solves
most people's problems? Maybe offer 'partial support' so that people like
me can write small functions that still compile *because we're using common
2.7/3.4 syntax* and collect bug reports to help with prioritisation over
the longer term?

I'd strongly suggest gathering evidence of current & future usage patterns
by running a survey, I've written loads of surveymonkey surveys and the
results are always *very* useful. I'm happy to proof read and suggest if
you'd like thoughts on this step.

Re. anaconda support - this would be *excellent*. Anything that lowers the
barrier to trialling it should be considered - numba+Cython come for free
by default in Anaconda so they're easy for people to try. The first version
could even just be a short guide telling people how to get it working in
Anaconda.

Ian.

On 6 November 2014 15:08, Pierrick Brunet <pierrick.brunet@xxxxxxxx> wrote:

> Hi Ian,
>
> As you said, increasing people are shifting to Python 3 but a lot of
> people are still using Python 2.7 for now and many python library didn't
> shift yet so IMO, we should not switch to fast between Python 2.7 and
> Python 3.X
> Also, Python representation for Python 2.7 and Python 3.x are different so
> it would mean we need to maintains a lots more code for this support and I
> am not sure we have enough engineering time for this (but if someone want
> to contribute it, let's go !!! )
> For these reasons, I think Python 3.X will not be available soon in
> Pythran but two step can be done.
> 1) switching internal Python code from 2.7 to 3.X (or having a code
> supporting both versions)
> 2) having a switch to generate Python 3.X pythran modules from Python 2.7
> code.
>
> Once these steps are done, a total switch from 2.7 to 3.x could be
> considers.
> Serge may have another opinion.
>
> Pierrick
>
>
> On 06/11/2014 15:34, Ian Ozsvald wrote:
>
>> Hi all. I taught a 2 day High Performance Python course last week, I've
>> upgraded all my material to Python 3.4. I talked about pythran along with
>> giving demos of Numba, PyPy and focusing on Cython (these 3 all have Python
>> 3+ support).
>>
>> Do you have plans to support Python 3? Within 5 years Python 2.7 will be
>> dead (the sunset date is 2020) and I get the feeling that increasingly
>> people are shifting up to Python 3, then not looking back. I use Python 3.4
>> for all client work now - sklearn, numpy, nltk, pymongo, pymysql etc all
>> work fine using Anaconda.
>>
>> Ian.
>>
>> --
>> Ian Ozsvald (A.I. researcher)
>> ian@xxxxxxxxxxxxxx
>>
>> http://IanOzsvald.com
>> http://ModelInsight.io
>> http://MorConsulting.com
>> http://Annotate.IO
>> http://SocialTiesApp.com
>> http://TheScreencastingHandbook.com
>> http://FivePoundApp.com
>> http://twitter.com/IanOzsvald
>> http://ShowMeDo.com
>>
>
>
>


-- 
Ian Ozsvald (A.I. researcher)
ian@xxxxxxxxxxxxxx

http://IanOzsvald.com
http://ModelInsight.io
http://MorConsulting.com
http://Annotate.IO
http://SocialTiesApp.com
http://TheScreencastingHandbook.com
http://FivePoundApp.com
http://twitter.com/IanOzsvald
http://ShowMeDo.com

Other related posts: