Re: The Incredible Growth of Python (stackoverflow.blog)(kdnuggets)

2017-09-15 Thread Vincent Vande Vyvre

Again an other review:

http://www.kdnuggets.com/2017/08/python-overtakes-r-leader-analytics-data-science.html

Vincent
--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-14 Thread Christopher Reimer
> On Sep 13, 2017, at 10:12 PM, Paul Rubin  wrote:
> 
> Ben Finney  writes:
>>> I've never seen one.
>> who has told you... they are working on a Python 3 code base.
> 
> Just because they've told me about it doesn't mean I saw it personally.
> The ones I've seen, including new ones, are Python 2.
> 
> Some people here use Py3 but I haven't heard (or don't remember) enough
> about what they're working on, to know if those are py3 codebases of any
> size.  If they say yes, I'll take their word for it, but this is a
> self-selected group of course.
> 
>> That simply isn't true, unless you think it more likely everyone who
>> discusses their Python 3 code base is lying.
> 
> People discuss Python language issues here a lot, but don't discuss as
> much about code bases.
> 
> I know when I install a new OS (currently Debian 9 which was released
> a month or so ago) and type "python" on the command line, I get Py2.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

FreeNAS 11 (based on FreeBSD) has Python 3.6.1 installed and uses Django for 
the web interface.

Chris R.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-14 Thread Mark Lawrence via Python-list

On 14/09/2017 05:37, Terry Reedy wrote:

On 9/13/2017 2:44 AM, Paul Rubin wrote:


Are there actually Py3 codebases?


Let's think a bit.  There is the Python half of the Python3 codebase, 
perhaps 400K.  But we can discount that.


Then there are all the Py compatible modules on PyPI, which is to say, 
most of the major one.  How could not not notice those?


One of them is a little project call Django.  I believe that this is the 
one slated to be 3.x only in its 2.0 version.


I believe at least one linux distribution uses Py 3 for its system python.

A year ago, a producers of a Unicode-based app sold internationallly 
announce that their next version would be Py 3 only.  When 3.3 came out 
with the new Unicode implementation, they developed a 3.3 version of the 
app.  By 3.5, they realized that 3.3+ unicode made things much easier, 
wile maintaining the 2.7 version was painful by comparison.  They asked 
their (non-programmer) customers if they already used the 3.x version or 
could install 3.x to run the 3.x version.  95% said yes to one of these. 
  So they decided that the next version, early this year, would be 3.x 
only.


Have you ever hear of a little startup called 'Instagram'?  Earlier this 
year, they announce that they had about finished an 18 month process of 
switching most of their Python code to 3.x.  They described in fair 
detail how they did it.  Really impressive.




Not quite there yet but according to this 
https://www.reddit.com/r/Python/comments/6z6wst/twisted_is_93_ported_to_python_3/ 
a little project called Twisted is 93% ported to Python 3.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

---
This email has been checked for viruses by AVG.
http://www.avg.com


--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-13 Thread Paul Rubin
Ben Finney  writes:
>> I've never seen one.
> who has told you... they are working on a Python 3 code base.

Just because they've told me about it doesn't mean I saw it personally.
The ones I've seen, including new ones, are Python 2.

Some people here use Py3 but I haven't heard (or don't remember) enough
about what they're working on, to know if those are py3 codebases of any
size.  If they say yes, I'll take their word for it, but this is a
self-selected group of course.

> That simply isn't true, unless you think it more likely everyone who
> discusses their Python 3 code base is lying.

People discuss Python language issues here a lot, but don't discuss as
much about code bases.

I know when I install a new OS (currently Debian 9 which was released
a month or so ago) and type "python" on the command line, I get Py2.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-13 Thread Terry Reedy

On 9/13/2017 2:44 AM, Paul Rubin wrote:


Are there actually Py3 codebases?


Let's think a bit.  There is the Python half of the Python3 codebase, 
perhaps 400K.  But we can discount that.


Then there are all the Py compatible modules on PyPI, which is to say, 
most of the major one.  How could not not notice those?


One of them is a little project call Django.  I believe that this is the 
one slated to be 3.x only in its 2.0 version.


I believe at least one linux distribution uses Py 3 for its system python.

A year ago, a producers of a Unicode-based app sold internationallly 
announce that their next version would be Py 3 only.  When 3.3 came out 
with the new Unicode implementation, they developed a 3.3 version of the 
app.  By 3.5, they realized that 3.3+ unicode made things much easier, 
wile maintaining the 2.7 version was painful by comparison.  They asked 
their (non-programmer) customers if they already used the 3.x version or 
could install 3.x to run the 3.x version.  95% said yes to one of these. 
 So they decided that the next version, early this year, would be 3.x only.


Have you ever hear of a little startup called 'Instagram'?  Earlier this 
year, they announce that they had about finished an 18 month process of 
switching most of their Python code to 3.x.  They described in fair 
detail how they did it.  Really impressive.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-13 Thread justin walters
On Tue, Sep 12, 2017 at 11:44 PM, Paul Rubin 
wrote:

> Chris Angelico  writes:
> > Why? Unless they're going to be maintaining a Py2 codebase, why should
> > they learn the older version with less features?
>
> Are there actually Py3 codebases?  I guess there must be, even though
> I've never seen one.  Every Python codebase of any size that I know of
> is Py2.  So yes, of course they're working on a Py2 codebase.  That's
> the only kind there is, as far as I know.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

This is Zed Shaw levels of willful ignorance here.

The codebase I work on at my job is entirely Python 3.

I'm sure the same is true for anyone building a new piece of software with
Python since at least 2015.

Not everyone gets paid to maintain legacy software in "enterprise"
corporations. Some
of us are contractors or work for startups.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread leam hall
On Tue, Sep 12, 2017 at 8:28 AM, Steve D'Aprano 
wrote:

> On Tue, 12 Sep 2017 09:20 pm, Leam Hall wrote:
>
> > But if someone comes onto the list, or IRC, and says they need to stay
> > on Python 2 then please drop the dozens of e-mails and comments about
> > upgrading.
> [...]
> > My recent experience with some people's inability to take "Sorry, I
> > can't" for an answer has been a real turn-off. I have requirements that
> > dictate Python. If this was a personal venture I'd already be elsewhere
> > purely because the Python community on the list and IRC is so
> unwelcoming.
>
> Leam, I've defended people choosing to remain on older versions of Python,
> even
> as old as 1.5. The most recent was just a couple of minutes ago, in my
> response
> to Chris. It's not nice or friendly of you to tar the entire community
> with a
> reputation because of one or two people saying something you don't want to
> debate.
>
> But it isn't all about you. Just because you started this thread -- oh
> wait, you
> didn't *wink* -- doesn't mean you control its direction. If people want to
> discuss the pros and cons of upgrading, without specifically badgering
> you, you
> should remember that *it isn't about you* and don't take it personally.
>

Steve, just a quick follow-up. Thank you for calling me out on this! It's
wrong for me to do something I complain about others doing. Feel free to
reach through the ether and smack me if I do this again.

Leam
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Rick Johnson
Steve D'Aprano wrote:
> Chris Angelico wrote:
> 
> [...]
> > > 
> > > Yet look at your answer; "upgrade". For a person working
> > > on a server there's usually no economic choice to do. The
> > > OS python must stay in place and the newly installed
> > > upgrade must be personally maintained, updated, and
> > > tested when security patches come out. For one desktop
> > > that's not an issue. For dozens, or hundreds, or
> > > thousands, its not likely to happen.
> > 
> > Until you get hit by a vulnerability that was patched four
> > years ago, but you didn't get the update. Now your server
> > is down - or, worse, has been compromised. What's the
> > economic cost of that?
> 
> Chris, that's what your subscription to RHEL pays for:
> backports of security fixes that the free Python 2.6
> doesn't contain.  You'll probably get them on Centos and
> Fedora too, the community editions of RHEL. You *won't* get
> them from the Python website. That's the whole point of the
> ten year support for RHEL (longer if you pay more).
> 
> >
> > You might choose to accept that risk, but you have to at
> > least be aware that you're playing with fire. Laziness is
> > not the cheap option in the long run.
> 
> You're making unjustified assumptions about the attack
> surface here. Maybe any attacker has to break through three
> firewalls *and* get root on the server before they can
> attack the Python app -- in which case they've got bigger
> problems than the Python vulnerability.  It's one thing to
> mention in a friendly way the advantages of upgrading.
> It's another to continue to brow-beat the poster about the
> (supposed) necessity to give up their paid RHEL support and
> security patches in favour of taking their chances with the
> free, but more recent, version where they have to monitor
> the Python website or mailing lists themselves and manually
> upgrade each time there's an security patch.  Feel free to
> continue to talk in general terms about the costs and
> benefits of upgrading, but stop badgering Leam. Not
> everyone values being on the bleeding edge, and Red Hat
> customers as a rule value stability and long term support
> over the latest shiny new features.

Great reply! And nice to know that not every Pythonista here
has gone tin-foil-hat crazy over Python3. 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Paul Moore
On 12 September 2017 at 13:47, Leam Hall  wrote:
> A few months ago my manager asked about what direction I recommended for the
> team. I'm the opinionated old guy who is new to this team. At the time I was
> really enjoying Ruby; just so dang fun!
>
> I told my manager that we should use python. It is the best choice for the
> team since we're on RHEL 6. Ruby wasn't on the machines but Python 2.6.6 is.
> Any code I write that is python 2.6.6 compatible should run on every
> machine.
>
> My answer meant I had to re-direct personal time and attention so I could
> help the team move forward. There are certain things I can do; learn to code
> better, write more tests, and figure out OOP. Some things I can't do;
> changing the supported python version is on that list.
>
> Python is the right choice for a lot of use cases. Python 3 is the right
> choice for a large sub-set of those use cases. Python 2 is the best choice
> for a much smaller subset.

Sounds like a very reasonable decision - I'm in a similar situation at
times, and I agree with your recommendation. Python's a great tool,
and if you like Ruby you should find it really easy to get into. As
you say, if Ruby isn't available on the machines you're working with,
the hurdle of getting it installed is likely a real blocker. Having
Python installed makes it a good choice - and sticking with the
installed version is definitely correct, otherwise you're no better
off than you were with a language that's not installed by default.

One thing you will have to deal with is that there's a lot less
support available for Python 2.6 these days - most developers working
with Python 2 will use 2.7, and new developers will typically pick
Python 3 if at all possible. For a lot of things, you're relying on
community support, which does mean you are "stuck" with what people
are enthusiastic about. But the good news is that most advice you'll
get is transferrable back to Python 2.6 (with a little care,
particularly if it was originally for Python 3). And it's important to
remember that community support is just that - individuals, offering
help simply because they love Python. And those individuals are
typically (in most communities, not just Python) early adopters, and
strongly prefer working with the latest versions.

The biggest hurdle you may hit is that 3rd party libraries are
starting to drop support of Python 2.6. I don't know if you expect to
use libraries from PyPI - in my environment, the systems that are
locked to Python 2.6 are typically not connected to the internet, so
non-stdlib code is generally not accessible - if that's the case for
you this won't be an issue. Unfortunately, there's not much you can do
about that - it's just one of the issues of working with older,
unsupported versions.

But a big plus with Python is that the stdlib is very comprehensive
(less so with 2.6 than 3.6, but still very good in 2.6). So where
you'd need to rely on external libraries for other languages, you can
do an awful lot with a base 2.6 install. That's a big selling point in
a locked down environment.

Anyway, I'm not sure there's much specific here. But thanks for taking
the time to explain your situation, which hopefully will act as a
reminder that not everyone trying to promote Python has a clean slate
to work with.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Stephan Houben
Op 2017-09-12, Tim Golden schreef :

> I agree. Except for the unusual case where someone's mistakenly chosen 
> to use, eg, Python 2.4 because they're using an old text book which 
> mentions it as the current version, most people are using the version 
> which suits them for one reason or another.

If it is not clear from the original post that they are consciously
using an old version, I will often try to politely suggest they use the
latest version (i.e. "If there is no particular reason for you to use
Python 1.5.2, may I suggest that you use 3.6 instead?").

The reason is that:

* On many operating systems, just typing "python" will give you
  Python2.7 at best (e.g. macOS!). And the OP may not be aware that
  there are more recent versions.

* In businesses, it is especially common to run on some RHEL version
  $ANCIENT; not so long ago I had a machine where typing "python"
  presented me with Python 2.3!

I agree that *badgering* them about it (as opposed to suggesting it
*once*) is a bad idea.

> And, if I may put my 2.5p-worth in here, they're probably using the 
> operating system which suits them. (Maybe because their employer has 
> said so, or because they're familiar or whatever). So saying, as people 
> occasionally do, "Upgrade to Linux", even with half-a-wink, is not 
> really that funny or helpful.

It's not really the same, though.

Changing the OS is a big undertaking and affects all their programs,
just installing version 3.6 of Python as a private user shouldn't affect
anything else. You can install python in your home directory on your
ancient RHEL box and leave the system Python happily at 2.3.

I nowadays typically never bother with the system Python for my own
development and just install a recent version of my choice locally.  It
saves a lot of headaches. The system Python is there to run system
programs.

Stephan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Leam Hall

On 09/12/2017 08:28 AM, Steve D'Aprano wrote:

On Tue, 12 Sep 2017 09:20 pm, Leam Hall wrote:


But if someone comes onto the list, or IRC, and says they need to stay
on Python 2 then please drop the dozens of e-mails and comments about
upgrading.

[...]

My recent experience with some people's inability to take "Sorry, I
can't" for an answer has been a real turn-off. I have requirements that
dictate Python. If this was a personal venture I'd already be elsewhere
purely because the Python community on the list and IRC is so unwelcoming.


Leam, I've defended people choosing to remain on older versions of Python, even
as old as 1.5. The most recent was just a couple of minutes ago, in my response
to Chris. It's not nice or friendly of you to tar the entire community with a
reputation because of one or two people saying something you don't want to
debate.

But it isn't all about you. Just because you started this thread -- oh wait, you
didn't *wink* -- doesn't mean you control its direction. If people want to
discuss the pros and cons of upgrading, without specifically badgering you, you
should remember that *it isn't about you* and don't take it personally.


WHAT?!?!?!  It isn't all about me?  Dang...

Steve, you're right; sorry for painting with such a broad brush. Even 
the people who occasionally post something that seems problematic (to 
me) are usually helpful.


A few months ago my manager asked about what direction I recommended for 
the team. I'm the opinionated old guy who is new to this team. At the 
time I was really enjoying Ruby; just so dang fun!


I told my manager that we should use python. It is the best choice for 
the team since we're on RHEL 6. Ruby wasn't on the machines but Python 
2.6.6 is. Any code I write that is python 2.6.6 compatible should run on 
every machine.


My answer meant I had to re-direct personal time and attention so I 
could help the team move forward. There are certain things I can do; 
learn to code better, write more tests, and figure out OOP. Some things 
I can't do; changing the supported python version is on that list.


Python is the right choice for a lot of use cases. Python 3 is the right 
choice for a large sub-set of those use cases. Python 2 is the best 
choice for a much smaller subset.



--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Tim Golden

On 12/09/2017 12:20, Leam Hall wrote:
This is an area the Python community can improve on. Even I would 
encourage someone new to Python and wanting to do webdev to use Python 3.


But if someone comes onto the list, or IRC, and says they need to stay 
on Python 2 then please drop the dozens of e-mails and comments about 
upgrading. Help the person learn; that makes them happier with Python 
and when the time comes to switch to Python 3 they probably will.


My recent experience with some people's inability to take "Sorry, I 
can't" for an answer has been a real turn-off. I have requirements that 
dictate Python. If this was a personal venture I'd already be elsewhere 
purely because the Python community on the list and IRC is so unwelcoming.


I agree. Except for the unusual case where someone's mistakenly chosen 
to use, eg, Python 2.4 because they're using an old text book which 
mentions it as the current version, most people are using the version 
which suits them for one reason or another.


And, if I may put my 2.5p-worth in here, they're probably using the 
operating system which suits them. (Maybe because their employer has 
said so, or because they're familiar or whatever). So saying, as people 
occasionally do, "Upgrade to Linux", even with half-a-wink, is not 
really that funny or helpful.


That said, my experience of this list and other Python forums is that we 
don't do *too* badly at being friendly. However, what we do suffer from 
is an excess of technical helpfulness. In principle it's a good thing, 
but it can give rise to solving a problem with the OP doesn't have. One 
example of which is: over-egging the advantages of Python 3. ("How do I 
do X in Python 2.7?" "Why aren't you using Python 3"). Another might be: 
suggesting a toolkit they're not using. ("How do I use Tkinter to do 
blah?" "Use Pygame; it's much better").


Of course, such advice can certainly be helpful, eg pointing out the 
advantages of requests over urllib2 etc. But trying to answer their 
question as well as pointing out possible alternatives is probably more 
friendly.


TJG
--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Ned Batchelder
On 9/12/17 7:40 AM, Chris Angelico wrote:
> On Tue, Sep 12, 2017 at 9:34 PM, Leam Hall  wrote:
>> On 09/12/2017 07:27 AM, Chris Angelico wrote:
>>> On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall  wrote:
 Hey Chris,

 This is an area the Python community can improve on. Even I would
 encourage
 someone new to Python and wanting to do webdev to use Python 3.

 But if someone comes onto the list, or IRC, and says they need to stay on
 Python 2 then please drop the dozens of e-mails and comments about
 upgrading. Help the person learn; that makes them happier with Python and
 when the time comes to switch to Python 3 they probably will.
>>>
>>> If you read back in my emails, you may find that I actually wasn't
>>> telling you to upgrade to Python 3 - just to Python 2.7, which is an
>>> easy upgrade from 2.6, and gives you the security fixes and other
>>> improvements that come from using a supported version of the language.
>>> Is it "hostile" to tell people to upgrade like that? If someone is
>>> using Python 3.2 today, I'm going to strongly recommend upgrading to
>>> the latest 3.x. If someone's using Windows 98, I'm not going to say
>>> "well, here's how to get everything working under Win98", I'm going to
>>> say "upgrade to a better OS".
>>>
>>> If that's hostile, I am not sorry to be hostile. At some point, you
>>> have to either get onto something supported, or do all the support
>>> work yourself.
>>>
>>> ChrisA
>>>
>> Hey Chris; only some folks were overtly hostile.  :)
>>
>> Yet look at your answer; "upgrade". For a person working on a server there's
>> usually no economic choice to do. The OS python must stay in place and the
>> newly installed upgrade must be personally maintained, updated, and tested
>> when security patches come out. For one desktop that's not an issue. For
>> dozens, or hundreds, or thousands, its not likely to happen.
> Until you get hit by a vulnerability that was patched four years ago,
> but you didn't get the update. Now your server is down - or, worse,
> has been compromised. What's the economic cost of that?
>
> You might choose to accept that risk, but you have to at least be
> aware that you're playing with fire. Laziness is not the cheap option
> in the long run.
>
> ChrisA

Leam has done us the favor of explaining how this list feels to people
coming into it. We should take his point of view seriously.  You are
still arguing about whether software should be upgraded.  Maybe it
should be, but it wasn't was the OP was asking about. 

The OP probably also isn't saving enough for retirement, and it's good
advice to save more, but it's not what they were asking about.  How far
afield from the actual question is it OK to offer unsolicited advice
before it comes off as hostile? Apparently we crossed the line on this
question.

--Ned.

--Ned.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Leam Hall

Steve,

Thank you very much. I appreciate your wisdom and support.

Leam
--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Chris Angelico
On Tue, Sep 12, 2017 at 9:34 PM, Leam Hall  wrote:
> On 09/12/2017 07:27 AM, Chris Angelico wrote:
>>
>> On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall  wrote:
>>>
>>> Hey Chris,
>>>
>>> This is an area the Python community can improve on. Even I would
>>> encourage
>>> someone new to Python and wanting to do webdev to use Python 3.
>>>
>>> But if someone comes onto the list, or IRC, and says they need to stay on
>>> Python 2 then please drop the dozens of e-mails and comments about
>>> upgrading. Help the person learn; that makes them happier with Python and
>>> when the time comes to switch to Python 3 they probably will.
>>
>>
>> If you read back in my emails, you may find that I actually wasn't
>> telling you to upgrade to Python 3 - just to Python 2.7, which is an
>> easy upgrade from 2.6, and gives you the security fixes and other
>> improvements that come from using a supported version of the language.
>> Is it "hostile" to tell people to upgrade like that? If someone is
>> using Python 3.2 today, I'm going to strongly recommend upgrading to
>> the latest 3.x. If someone's using Windows 98, I'm not going to say
>> "well, here's how to get everything working under Win98", I'm going to
>> say "upgrade to a better OS".
>>
>> If that's hostile, I am not sorry to be hostile. At some point, you
>> have to either get onto something supported, or do all the support
>> work yourself.
>>
>> ChrisA
>>
>
> Hey Chris; only some folks were overtly hostile.  :)
>
> Yet look at your answer; "upgrade". For a person working on a server there's
> usually no economic choice to do. The OS python must stay in place and the
> newly installed upgrade must be personally maintained, updated, and tested
> when security patches come out. For one desktop that's not an issue. For
> dozens, or hundreds, or thousands, its not likely to happen.

Until you get hit by a vulnerability that was patched four years ago,
but you didn't get the update. Now your server is down - or, worse,
has been compromised. What's the economic cost of that?

You might choose to accept that risk, but you have to at least be
aware that you're playing with fire. Laziness is not the cheap option
in the long run.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Chris Angelico
On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall  wrote:
> Hey Chris,
>
> This is an area the Python community can improve on. Even I would encourage
> someone new to Python and wanting to do webdev to use Python 3.
>
> But if someone comes onto the list, or IRC, and says they need to stay on
> Python 2 then please drop the dozens of e-mails and comments about
> upgrading. Help the person learn; that makes them happier with Python and
> when the time comes to switch to Python 3 they probably will.

If you read back in my emails, you may find that I actually wasn't
telling you to upgrade to Python 3 - just to Python 2.7, which is an
easy upgrade from 2.6, and gives you the security fixes and other
improvements that come from using a supported version of the language.
Is it "hostile" to tell people to upgrade like that? If someone is
using Python 3.2 today, I'm going to strongly recommend upgrading to
the latest 3.x. If someone's using Windows 98, I'm not going to say
"well, here's how to get everything working under Win98", I'm going to
say "upgrade to a better OS".

If that's hostile, I am not sorry to be hostile. At some point, you
have to either get onto something supported, or do all the support
work yourself.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Rustom Mody
On Monday, September 11, 2017 at 1:28:24 PM UTC+5:30, Marko Rauhamaa wrote:
> Gregory Ewing:
> 
> > Chris Angelico wrote:
> >> Async functions in
> >> JS are an alternative to callback hell; most people consider async
> >> functions in Python to be an alternative to synchronous functions.
> >
> > What do you base that on? Seems to me async is an alternative
> > to callback-based frameworks such as Twisted.
> >
> > Calling async functions an alternative to sync functions
> > doesn't make sense, because if sync functions will do what
> > you want, there's no need to use async ones.
> 
> Asyncio makes it possible to write a single-threaded program in
> multithreading style.
> 
> The multithreading style means entwining the state of a finite state
> machine in the form of the source code. While a callback-based program
> will use one or more variables (object attributes) to store the state --
> or leave it implicit -- an asyncio program marks each state with the
> "await" keyword.
> 
> The multithreading style is convenient in cases where each state is
> blocked on a single possible event. Trouble is, most state machines I
> run into (and that's my bread and butter), each state is blocked on
> several or even numerous alternative events.

Do you have some reading material suggestions for grokking the a-world?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Paul Rubin
Chris Angelico  writes:
> students learning Python *today* ... they're learning Python 3.

I'm not so sure of that.  I do know a few people currently learning
Python, and they're using Python 2.

>>  * static type annotation

Seems like a big win if you ask me.

>>  * asyncio with its a-dialect
> Actually, I think this one is a huge enough feature that it's going to
> be a big thing to *drive* the uptake of Python.

God I hope not, it's perverse.  I'd like to see a Python that's more
like Erlang in its approach to concurrency.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Michael Torrie
On 09/11/2017 08:36 AM, Dennis Lee Bieber wrote:
> On Mon, 11 Sep 2017 18:35:02 +1000, Chris Angelico 
> declaimed the following:
> 
>>
>> Do a quick poll here on the list. Who sees async functions as an
>> alternative to Twisted? Who here has even *used* Twisted? (How many
>> even know what it is?)
>>
>   Tried to read the Twisted documentation back when it was the new
> mousetrap... Couldn't get my head to understand it then, never looked back.
> Threading has worked well for everything I've done (granted, the most
> recent "major" effort involved two threads each reading Wireshark captures,
> parsing out specific packets, and forwarding them to a third thread via
> Queues, so the third thread could match sent vs rcvd and compute time
> differences, writing results to SQLite3).

I know the feeling.  However once it clicks, Twisted isn't that hard to
understand in abstract.  Data event happens, data is passed to a chain
of callbacks. The output of one handler is passed as input to the next.
Think of it a bit like chaining generator functions.  If an exception
occurs along the way, execution shifts from the callback chain to an
error handling callback chain.  The bit that was hard for me to
understand is that somewhere, somehow, the something has to trigger the
event. That's the magic/hidden part often, buried in layers of
inheritance in the Twisted core.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Michael Torrie
On 09/11/2017 02:35 AM, Chris Angelico wrote:
> Do a quick poll here on the list. Who sees async functions as an
> alternative to Twisted? Who here has even *used* Twisted? (How many
> even know what it is?)

/me raises hand, slowly, cautiously looking around.  I don't think of
twisted so much as an alternative to threading, but rather a way of
doing event-driven programming with I/O, which does work well as an
alternative to threading.  This model actually fits really well with
protocol implementations. For example in http, each request can be an
"event" that the Twisted stack can process.  When using the LDAP
protocol adapter, each request type can be an event (ADD, MODIFY,
DELETE, etc).

As I understand it, Twisted now runs in conjunction with the new async
stuff.  Apparently you can use both traditional callback style Twisted
programming and the new async stuff together in one program.  And rather
than replace Twisted, the new async core in Python can actually drive
Twisted.

The problem with Twisted is it's really, really hard for a beginner to
mentally trace the execution of code, particularly when you're using an
existing protocol adapter class as your base.  Took me about two weeks
to fully understand the Twisted LDAP server example.

Does the new Async facility in Python make it easier to trace program
flow and logic?

> Personally, I think of them as an alternative to threading. Basically
> they're a way to use the code style of threaded I/O (functions that
> block when they need to read from a socket etc) with the light-weight
> efficiency of doing everything in one thread. I have never used
> Twisted.

If you ever want to do I/O and run a GUI at the same time, Twisted is
probably going to remain your best bet since it integrates tightly with
the major GUIs' event loops.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Gregory Ewing

Chris Angelico wrote:

Async functions in
JS are an alternative to callback hell; most people consider async
functions in Python to be an alternative to synchronous functions.


What do you base that on? Seems to me async is an alternative
to callback-based frameworks such as Twisted.

Calling async functions an alternative to sync functions
doesn't make sense, because if sync functions will do what
you want, there's no need to use async ones.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Steve D'Aprano
On Mon, 11 Sep 2017 12:46 am, Rick Johnson wrote:

> if we consider the damage that small changes
> (like the print statement versus print function and
> raw_input versus input) have caused


The word for negative damage is "improvement".



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Marko Rauhamaa
Dennis Lee Bieber :

>   In contrast, every sample I've seen of the async library comes
> across as "magic happens here -- at some point in time".

That magic can be learned, in principle. I'm afraid few programmers will
be willing/able to get over the hump, and there are a number of tricky
aspects to be extra careful about.

The situation *did* get significantly better with "async" replacing
"@coroutine" and "await" replacing "yield from". However, it is easy to
accidentally forget to place the "await" keyword where it belongs and
quite a bit of troubleshooting can go into locating the mistake because
the faulty program runs without an (immediate) exception.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread breamoreboy
On Sunday, September 10, 2017 at 6:07:00 AM UTC+1, Ben Finney wrote:
> Gene Heskett writes:
> 
> > On Saturday 09 September 2017 21:48:44 Chris Angelico wrote:
> >
> > > The Python Secret Underground emphatically does not exist.
> >
> > Humm. here all this time I thought you were a charter member. :)
> 
> With all the authority vested in me as a charter member, I can
> categorically say the Python Secret Underground does not exist.
> 
> -- 
>  \   “Pinky, are you pondering what I'm pondering?” “Well, I think |
>   `\ so, Brain, but first you'd have to take that whole bridge |
> _o__) apart, wouldn't you?” —_Pinky and The Brain_ |
> Ben Finney

How has Python managed world domination without the aid of Pinky and the Brain?

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Rick Johnson
Chris Angelico wrote:
> Marko Rauhamaa wrote:

[...]

> > The clouds I see looming over Python's head are:
> >
> >  * 2-to-3 migration
> 
> If that was going to kill Python, it would have had some
> impact by now. There are students learning Python *today*
> who are never going to have to worry about the migration,
> because they're learning Python 3.
> 
> >  * static type annotation
> 
> I'm not seeing very much of this in the wild yet, but
> honestly, it's not that big a deal. You can ignore it if
> you want to.

Kinda difficult to ignore type annotations when they are
intermixed with the code!

I never really had a problem with the idea of Python having
type-hints, so long as the ugly annotations were kept
_separated_ from the .py[w] files, but for some reason, the
devs decided that mucking up Python's clean syntax for the
sake of (what you claim is) a small minority of type-hint
fanboys, was okay...

The fanboys of type-hints claim that we will never (or
hardly ever) see these annotations in the wild, but again,
if that is the case, *IF* usage of this feature is really
that rare, then why should it be given such power to
undermine the readability of Python code? It is not too
late! We are still in the very early stages of type-hints,
and we can undo the damage that this "feature" will cause if
we remove the hints from the .py[w] files entirely. Let the
burden be on those who want this feature, not on those who
don't want it.

Futhermore, if we consider the damage that small changes
(like the print statement versus print function and
raw_input versus input) have caused, how can we expect
(short of a self delusion) that type-hints will have no
negative effects?

There is one aspect of the internet that will never change,
namely: persistance, and from now, and until Python
disappears from the universe, there will always be a need to
explain why `print` was changed from a statement to a
function, along with an explanation of the subtle
differences between python2's raw_input() and input() versus
Python3's input(), not to mention the age old ramblings
about classic classes versus new classes. And as much as
we'd all like for these confusions to go away, they won't,
because there is no way to "clean" the internet of every
Python2 tutorial, blog or website that mentions these bygone
features.

The stain of Python3's violent and radical changes to the
core philosophy of the language may never be washed clean,
and although we might have survived Python3 _eventually_,
type-hints is like a wooden stake driven into the heart of
this community. It's almost like they _want_ to destroy this
language. 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Marko Rauhamaa
Stephan Houben :

> Op 2017-09-10, Chris Angelico schreef :
>> Want to make something iterable? Define __iter__. Want to make it
>> async-iterable (with "async for")? Define __aiter__. It's a bit clunky
>> if you want the same object to be iterable both ways, but I don't know
>> of any real-world situations where that's the case.
>
> Would we not eventually want a file object to deliver its lines
> asynchronously (with non-blocking reads under the hood) if
> iterated over with "async for", while preserving the current
> blocking behavior in the "for" case?

I'm not exactly sure what your point is.

"async for" is needed to allow a for loop to iterate over a sequence
that is generated asynchronously. If you accidentally use a regular
"for" (and chances are you will), you will experience weird behavior.

As for file objects supporting asynchronous iterators, I agree they
should. Linux is not quite ready for nonblocking file access yet (the
kernel developers are busy trying to make it happen).

Note that you will not only need an async version of a file iterator but
also versions for the "open()" function, directory walking etc.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Marko Rauhamaa
Skip Montanaro :

>>  * asyncio with its a-dialect
>
> What is a/the "a-dialect"?

await
async def
async for
__aiter__
__anext__
async with
__aenter__
__aexit__

What's more, when you turn a function into an async, you need to
refactor a large part of your program.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Stephan Houben
Op 2017-09-10, Chris Angelico schreef :
> Want to make something iterable? Define __iter__. Want to make it
> async-iterable (with "async for")? Define __aiter__. It's a bit clunky
> if you want the same object to be iterable both ways, but I don't know
> of any real-world situations where that's the case.

Would we not eventually want a file object to deliver its lines
asynchronously (with non-blocking reads under the hood) if
iterated over with "async for", while preserving the current
blocking behavior in the "for" case?

Stephan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Chris Angelico
On Sun, Sep 10, 2017 at 7:45 PM, Skip Montanaro
 wrote:
>>  * asyncio with its a-dialect
>
> What is a/the "a-dialect"?

Want to make something iterable? Define __iter__. Want to make it
async-iterable (with "async for")? Define __aiter__. It's a bit clunky
if you want the same object to be iterable both ways, but I don't know
of any real-world situations where that's the case.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Gene Heskett
On Sunday 10 September 2017 01:06:00 Ben Finney wrote:

> Gene Heskett  writes:
> > On Saturday 09 September 2017 21:48:44 Chris Angelico wrote:
> > > The Python Secret Underground emphatically does not exist.
> >
> > Humm. here all this time I thought you were a charter member. :)
>
> With all the authority vested in me as a charter member, I can
> categorically say the Python Secret Underground does not exist.
>
Chuckle. But this is far out in the puckerbrush, and I'm out of string 
for my weed-eater.  And we got here in record time. ;-)
> --
>  \   “Pinky, are you pondering what I'm pondering?” “Well, I think
> | `\ so, Brain, but first you'd have to take that whole bridge
> | _o__) apart, wouldn't you?” —_Pinky and The
> Brain_ | Ben Finney


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Skip Montanaro
>  * asyncio with its a-dialect

What is a/the "a-dialect"?

S
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Gene Heskett
On Saturday 09 September 2017 21:48:44 Chris Angelico wrote:

> On Sun, Sep 10, 2017 at 11:41 AM, Gregory Ewing
>
>  wrote:
> > Pavol Lisy wrote:
> >> Interesting reading:
> >> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=
> >>1
> >
> > So, Python's rate of expansion is accelerating, like
> > the universe. Does that mean there's some kind of dark
> > energy fuelling its growth?
>
> The Python Secret Underground emphatically does not exist.
>
> ChrisA

Humm. here all this time I thought you were a charter member. :)

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Rustom Mody
On Sunday, September 10, 2017 at 7:12:10 AM UTC+5:30, Gregory Ewing wrote:
> Pavol Lisy wrote:
> > Interesting reading:
> > https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1
> 
> So, Python's rate of expansion is accelerating, like
> the universe. Does that mean there's some kind of dark
> energy fuelling its growth?

Something to do with the small Hamming-distance between "God" and "Guido" ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Chris Angelico
On Sun, Sep 10, 2017 at 11:41 AM, Gregory Ewing
 wrote:
> Pavol Lisy wrote:
>>
>> Interesting reading:
>> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1
>
>
> So, Python's rate of expansion is accelerating, like
> the universe. Does that mean there's some kind of dark
> energy fuelling its growth?

The Python Secret Underground emphatically does not exist.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list