[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Chris Angelico
On Sat, Aug 3, 2019 at 3:44 PM Steven D'Aprano wrote: > > On Sat, Aug 03, 2019 at 03:52:31AM +1000, Chris Angelico wrote: > > > Also a bit old-school (it took me many years to learn the value of > > syntax highlighting), and an educator, and I've seen students start > > out with Jupyter. As an

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Steven D'Aprano
On Sat, Aug 03, 2019 at 03:52:31AM +1000, Chris Angelico wrote: > Also a bit old-school (it took me many years to learn the value of > syntax highlighting), and an educator, and I've seen students start > out with Jupyter. As an alternative to the vanilla REPL, I think it's > awesome [...] > But

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Steven D'Aprano
On Sat, Aug 03, 2019 at 10:02:39AM +1000, Chris Angelico wrote: > On Sat, Aug 3, 2019 at 9:48 AM Steven D'Aprano wrote: > > > > On Fri, Aug 02, 2019 at 07:52:37AM +1000, Chris Angelico wrote: > > > > > Maybe there needs to be a > > > second-tier recommendation, where a list of packages can be

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Andrew Barnert via Python-ideas
On Aug 2, 2019, at 19:22, Brendan Barnwell wrote: > >> On 2019-08-02 19:16, Andrew Barnert wrote: >> >> So, that’s the way forward. You could port the recipes to C and >> change the docs recipes to be “roughly equivalent” Python code in the >> help for each function. Or you could port itertools

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Andrew Barnert via Python-ideas
On Aug 2, 2019, at 11:34, Christopher Barker wrote: > > The other issue here, in the context of the OP's proposal, is that it's less > than obvious that that's what a user would want when they want to operate on > all the items in a iterable without creating a new iterable. To Guido's >

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Brendan Barnwell
On 2019-08-02 19:16, Andrew Barnert wrote: PEP 399 says all _new_ modules (that don’t have a good reason for a special dispensation) have to have a pure Python implementation. But it explicitly says that pre-existing modules in the stdlib didn’t need to be rewritten, and most of them haven’t

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Andrew Barnert via Python-ideas
On Aug 2, 2019, at 15:45, Steven D'Aprano wrote: > > Are infinite for-loops that common that people get excited by cycle? > That sounds like the "here's a hammer, now every problem is a nail" > issue. "itertools.cycle is cool, I must use it as often as possible!" Well, they’re probably

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Chris Angelico
On Sat, Aug 3, 2019 at 9:48 AM Steven D'Aprano wrote: > > On Fri, Aug 02, 2019 at 07:52:37AM +1000, Chris Angelico wrote: > > > Maybe there needs to be a > > second-tier recommendation, where a list of packages can be given that > > aren't category killers, but have been given the blessing of the

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Steven D'Aprano
On Fri, Aug 02, 2019 at 07:52:37AM +1000, Chris Angelico wrote: > Maybe there needs to be a > second-tier recommendation, where a list of packages can be given that > aren't category killers, but have been given the blessing of the > Python devs as "this is a good-quality, well-maintained

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Steven D'Aprano
On Thu, Aug 01, 2019 at 12:31:48PM -0700, Andrew Barnert via Python-ideas wrote: > Plus, there is another potential argument for adding at least some of > the recipes to the module. When I show a novice how to import and use > cycle, they they get excited and go off and use it. Are infinite

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread David Mertz
There *is* also the '%load' magic. But 'from my_stuff import *' is almost always a better idea. On Fri, Aug 2, 2019, 2:49 PM Christopher Barker wrote: > Getting really OT now, but quickly: > > On Fri, Aug 2, 2019 at 11:28 AM Chris Angelico wrote: > >> On Sat, Aug 3, 2019 at 4:19 AM Ricky

[Python-ideas] Coding environments

2019-08-02 Thread David Mertz
On Fri, Aug 2, 2019, 1:56 PM Chris Angelico wrote: > Also a bit old-school (it took me many years to learn the value of > syntax highlighting), and an educator, and I've seen students start > out with Jupyter. As an alternative to the vanilla REPL, I think it's > awesome if a little expensive on

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Barry Scott
> On 1 Aug 2019, at 19:11, Guido van Rossum > wrote: > > This is an interesting phenomenon. I'm not saying it's good or bad, I'm just > observing it (because it surprised me). Here is someone declaring that the > docs are less accessible than the code. I personally

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Brendan Barnwell
On 2019-08-02 10:11, Andrew Barnert wrote: Honestly, I think a lot of the resistance is the implementation issue, or at least it’s the reason the resistance is hard to overcome. If someone isn’t sure whether the benefit of having itertools.consume is worth the cost of implementing and

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Ricky Teachey
> > > I think he means putting: > > > > import my_python_file > > > > in a cell, like any other python code. > Yes, that is all I meant. My super powered text editor experience is limited to Notepad++. Perhaps I have a lot to learn about what makes a good text editor for code. And I'm always

[Python-ideas] Re: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Barry Scott
I did a quick scan of the source code I have checkout. I see "no" as a variable in Python, PyPy, GitPython and setuptools. Adding "no" as a keyword will break at least those projects. Barry Here are the details: Python3/Lib/distutils/tests/test_util.py 249 no = ('n', 'no', 'f',

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Chris Angelico
On Sat, Aug 3, 2019 at 4:39 AM Christopher Barker wrote: > > Getting really OT now, but quickly: Off-list because it really is. > On Fri, Aug 2, 2019 at 11:28 AM Chris Angelico wrote: >> >> On Sat, Aug 3, 2019 at 4:19 AM Ricky Teachey wrote: >> > Remember that Jupyter has a pretty nice text

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Christopher Barker
Getting really OT now, but quickly: On Fri, Aug 2, 2019 at 11:28 AM Chris Angelico wrote: > On Sat, Aug 3, 2019 at 4:19 AM Ricky Teachey wrote: > > Remember that Jupyter has a pretty nice text editor Actually, I think it's pretty darn crappy -- at least compared to any "proper" coding

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Christopher Barker
This has gotten a bit OT, but I’ll roll with it. But what about `pip install more-itertools`? Hopefully you become >> comfortable with that a lot faster than 3 years in. > > more-itertools Is kind of a special case (or at least different case), as it’s a collection of handy general purpose

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Brendan Barnwell
On 2019-08-02 06:37, Rhodri James wrote: On 02/08/2019 06:26, Brendan Barnwell wrote: It is massively more discoverable, for one simple reason: autocomplete. In teaching people to program, I often use Jupyter notebook, which has great autocomplete functionality that can also bring up

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Christopher Barker
On Fri, Aug 2, 2019 at 10:54 AM Chris Angelico wrote: > Also a bit old-school (it took me many years to learn the value of > syntax highlighting), and an educator, and I've seen students start > out with Jupyter. As an alternative to the vanilla REPL, I think it's > awesome if a little expensive

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Dan Sommers
On 8/2/19 1:18 PM, David Mertz wrote: > I'm definitely on the old side of the distribution of programmers ... Throw me into that bucket, too. I use autocomplete to save typing rather than to discover new functionality. Autocompletion is great, if you know where to start. In the case that

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Chris Angelico
On Sat, Aug 3, 2019 at 4:19 AM Ricky Teachey wrote: >> >> as an >> alternative to a text editor, it's an attractive nuisance. Yes, you >> can try things out and see the results instantly, AND you can save it, >> edit, rerun, etc; the cost is that debugging becomes a nightmare. > > > Remember that

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Ricky Teachey
> > as an > alternative to a text editor, it's an attractive nuisance. Yes, you > can try things out and see the results instantly, AND you can save it, > edit, rerun, etc; the cost is that debugging becomes a nightmare. > Remember that Jupyter has a pretty nice text editor (with syntax

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Chris Angelico
On Sat, Aug 3, 2019 at 12:48 AM Ricky Teachey wrote: > > Notebooks in particular-- more than IDEs, I think-- are changing the way > people learn. if I were teaching someone new today, I'd have them use Jupyter > right away, probably not the repl. > > But I still use the docs a lot too. Also a

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread David Mertz
I'm definitely on the old side of the distribution of programmers, and I strongly appreciate tab expansion in tools like Jupyter and vim. I never used a full "IDE", whatever the boundary line is. But exactly that kind of reminder of e.g. "what's in itertools again?" is very helpful to me, both

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Andrew Barnert via Python-ideas
On Aug 1, 2019, at 22:26, Brendan Barnwell wrote: > >> On 2019-08-01 12:31, Andrew Barnert via Python-ideas wrote: >>> On Aug 1, 2019, at 10:48, Eli Berkowitz wrote: >>> > >>> >In terms of an argument for why it should be included, for most Python >>> >users the itertools recipes remain

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Rhodri James
On 02/08/2019 15:22, Guido van Rossum wrote: There seems to be a clash of generations here, or perhaps a clash of different educational paths. Very likely. I did my computer science learning on an IBM mainframe, with a local front-end over MVS. A full-screen editor was introduced during

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Stefan Krah
On Fri, Aug 02, 2019 at 10:48:26AM -0400, Ricky Teachey wrote: > I agree it is more a clash of learning paths/training. I started out-- with > ZERO knowledge-- in 2014 just before Jupyter started to be popular, and the > more I have used it (as well as VSCode and Pycharm), the more I have found >

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Ricky Teachey
> > > It is massively more discoverable, for one simple reason: >> > autocomplete. >> >> I am very uncomfortable with >> IDEs that try to do my thinking for me, and I start turning things off >> on those occasions when I am forced to use them. It would even occur to >> me to try

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Rhodri James
On 02/08/2019 06:26, Brendan Barnwell wrote: It is massively more discoverable, for one simple reason: autocomplete. In teaching people to program, I often use Jupyter notebook, which has great autocomplete functionality that can also bring up the documentation on any function. 

[Python-ideas] Re: For-expression/throwaway comprehension

2019-08-02 Thread Brendan Barnwell
On 2019-08-01 12:31, Andrew Barnert via Python-ideas wrote: On Aug 1, 2019, at 10:48, Eli Berkowitz wrote: > >In terms of an argument for why it should be included, for most Python users the itertools recipes remain unseen. Sure. But do you also know all of the functions in the module? Would

[Python-ideas] Fwd: Re: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Daniel Okey-Okoro
-- Forwarded message - From: Daniel Okey-Okoro Date: Thu, Aug 1, 2019 at 1:37 PM Subject: Re: [Python-ideas] Re: PEP: add a `no` keyword as an alias for `not` To: Chris Angelico > not a strong enough justification for breaking any code that uses "no" in any other way. This is

[Python-ideas] Fwd: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Daniel Okey-Okoro
-- Forwarded message - From: Daniel Okey-Okoro Date: Thu, Aug 1, 2019 at 1:24 PM Subject: Re: PEP: add a `no` keyword as an alias for `not` To: Calvin Spealman Good point Calvin, But in many cases, when people write

[Python-ideas] Re: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Steven D'Aprano
For some reason I haven't received the original email from Daniel. On Thu, Aug 01, 2019 at 04:10:24PM -0400, Calvin Spealman wrote: > I think they actually read like they would mean slightly different things, > which would make them existing as aliases confusing. I agree with Calvin. To me, "if