Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Terry Reedy
On 10/31/2017 10:41 AM, Nick Coghlan wrote: On 31 October 2017 at 05:57, Alex Walters > wrote: > While I completely agree with this in principle, I think you > overestimate the average beginner. The average Python beginner may

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Nick Coghlan
On 1 November 2017 at 08:50, Terry Reedy wrote: > In April 2016, after posting the idea to pydev list and getting 'go > ahead's from Nick Coughlin and someone else, with no negatives, I approved > Upendra Kumar's GSOC proposal to write a pip gui. This was >

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Nathaniel Smith
On Oct 31, 2017 4:42 AM, "Nick Coghlan" wrote: On 31 October 2017 at 02:29, Guido van Rossum wrote: > What's your proposed process to arrive at the list of recommended packages? > I'm thinking it makes the most sense to treat inclusion in the recommended

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Nick Coghlan
On 1 November 2017 at 05:56, Guido van Rossum wrote: > On Tue, Oct 31, 2017 at 12:24 PM, MRAB wrote: > >> At least Python 3.6 is only 1 year/release behind, which is fine! >> > > OK, so presumably that argument doesn't preclude inclusion in the 3.7

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Wes Turner
You could teach them subprocess and os command injection safety from the start: ```python import subprocess import sys cmd = [sys.executable, -m', 'pip', 'install', '-r', 'psfblessed-requirements.txt']) retcode = subprocess.check_call(cmd) assert retcode == 0 ``` (Because shell=True is dangerous

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Wes Turner
You could teach them subprocess and os command injection safety from the start: ```python import subprocess import sys cmd = [sys.executable, -m', 'pip', 'install', '-r', 'psfblessed-requirements.txt']) retcode = subprocess.check_call(cmd) assert retcode == 0 ``` (Because shell=True is

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Terry Reedy
On 10/31/2017 12:21 PM, Ivan Levkivskyi wrote: I think it was proposed several times before, but I just wanted to revive the idea that we could add a GUI interface to install/update packages from IDLE (maybe even with some package browser). https://bugs.python.org/issue23551. I agreed with

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Cameron Simpson
On 31Oct2017 22:50, Greg Ewing wrote: Koos Zevenhoven wrote: |defsingle(i): try: ||v =i.next() |||exceptStopIteration:raiseException('No values')|||try: ||i.next() ||exceptStopIteration: ||returnv||else: ||raiseException('Too many

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Chris Barker
On Tue, Oct 31, 2017 at 11:05 AM, Chris Angelico wrote: > > So I think defining a "pip" builtin that simply gave a helpful message > would > > be a good start. > > > > (hmm, it's a syntax error, so not as simple as a builtin -- but it could > be > > caught somehow to give a

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Guido van Rossum
On Tue, Oct 31, 2017 at 12:24 PM, MRAB wrote: > On 2017-10-31 18:44, Guido van Rossum wrote: > >> On Tue, Oct 31, 2017 at 11:41 AM, MRAB > > wrote: >> >> regex gets updated when the Unicode Consortium

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Steve Barnes
On 31/10/2017 18:05, Chris Angelico wrote: > On Wed, Nov 1, 2017 at 2:49 AM, Chris Barker wrote: >> And sure, some of those are completly clueless about what a command line is >> and how to use it, but others DO have an idea about the command line, but >> dont know that:

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread MRAB
On 2017-10-31 18:44, Guido van Rossum wrote: On Tue, Oct 31, 2017 at 11:41 AM, MRAB > wrote: regex gets updated when the Unicode Consortium releases an update. Is it a feature that that is more frequently than Python

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Guido van Rossum
On Tue, Oct 31, 2017 at 11:41 AM, MRAB wrote: > regex gets updated when the Unicode Consortium releases an update. > Is it a feature that that is more frequently than Python releases? There are other things in Python that must be updated whenever the UC releases an

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread MRAB
On 2017-10-31 11:42, Nick Coghlan wrote: On 31 October 2017 at 02:29, Guido van Rossum > wrote: What's your proposed process to arrive at the list of recommended packages? I'm thinking it makes the most sense to treat inclusion in the

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Chris Angelico
On Wed, Nov 1, 2017 at 2:49 AM, Chris Barker wrote: > And sure, some of those are completly clueless about what a command line is > and how to use it, but others DO have an idea about the command line, but > dont know that: > pip install something > File "", line 1 >

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Steven D'Aprano
On Tue, Oct 31, 2017 at 10:31:50AM +, אלעזר wrote: > Off topic: why can't we simply allow something like this: > > (the_bob) = (name for name in ('bob','fred') if name=='bob') Parens don't make a tuple. They are just for grouping. If you want a tuple, you need a comma: the_bob, =

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Wes Turner
On Tuesday, October 31, 2017, Guido van Rossum wrote: > On Tue, Oct 31, 2017 at 4:42 AM, Nick Coghlan > wrote: > >> On 31 October 2017 at 02:29, Guido van Rossum >

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Guido van Rossum
OK, go ahead and write the PEP! I'm actually happy with the responses you gave, so your last email will make a good start for some of the contents of the PEP. On Tue, Oct 31, 2017 at 9:19 AM, Nick Coghlan wrote: > On 1 November 2017 at 00:53, Guido van Rossum

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Ivan Levkivskyi
I think it was proposed several times before, but I just wanted to revive the idea that we could add a GUI interface to install/update packages from IDLE (maybe even with some package browser). -- Ivan ___ Python-ideas mailing list

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Nick Coghlan
On 1 November 2017 at 00:53, Guido van Rossum wrote: > On Tue, Oct 31, 2017 at 4:42 AM, Nick Coghlan wrote: > >> On 31 October 2017 at 02:29, Guido van Rossum wrote: >> >>> What's your proposed process to arrive at the list of recommended

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Chris Barker
oops, hit the send button too soon... here's some more: On Tue, Oct 31, 2017 at 8:41 AM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > > >> Nope. I totally get that they don’t know what a shell or command prompt >> is. THEY. NEED. TO. LEARN. Hiding it is not a good idea for

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Chris Barker - NOAA Federal
> Nope. I totally get that they don’t know what a shell or command prompt > is. THEY. NEED. TO. LEARN. Hiding it is not a good idea for anyone. I actually take this approach myself in my classes. However, I also have as prerequisites for my classes: Some Experience in some programming

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Guido van Rossum
On Tue, Oct 31, 2017 at 4:42 AM, Nick Coghlan wrote: > On 31 October 2017 at 02:29, Guido van Rossum wrote: > >> What's your proposed process to arrive at the list of recommended >> packages? >> > > I'm thinking it makes the most sense to treat inclusion in

Re: [Python-ideas] install pip packages from Python prompt

2017-10-31 Thread Nick Coghlan
On 31 October 2017 at 05:57, Alex Walters wrote: > > While I completely agree with this in principle, I think you > > overestimate the average beginner. > > Nope. I totally get that they don’t know what a shell or command prompt > is. THEY. NEED. TO. LEARN. Hiding it

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Soni L.
On 2017-10-31 10:58 AM, Joao S. O. Bueno wrote: On 31 October 2017 at 10:52, Steven D'Aprano wrote: On Tue, Oct 31, 2017 at 10:42:23AM -0200, Joao S. O. Bueno wrote: When I need something like this, I usually rop a line on the module namespace that goes like: first =

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Joao S. O. Bueno
On 31 October 2017 at 10:52, Steven D'Aprano wrote: > On Tue, Oct 31, 2017 at 10:42:23AM -0200, Joao S. O. Bueno wrote: >> When I need something like this, I usually rop a line on the module >> namespace that goes like: >> >> first = lambda x: next(iter(x)) > > That doesn't

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Steven D'Aprano
On Tue, Oct 31, 2017 at 10:42:23AM -0200, Joao S. O. Bueno wrote: > When I need something like this, I usually rop a line on the module > namespace that goes like: > > first = lambda x: next(iter(x)) That doesn't meet the requirement that x has ONLY one item. And using lambda like that is bad

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Joao S. O. Bueno
When I need something like this, I usually rop a line on the module namespace that goes like: first = lambda x: next(iter(x)) On 30 October 2017 at 23:09, Steven D'Aprano wrote: > On Tue, Oct 31, 2017 at 07:51:02AM +1100, Cameron Simpson wrote: > >> return the(nodes) >>

Re: [Python-ideas] Defining an easily installable "Recommended baseline package set"

2017-10-31 Thread Nick Coghlan
On 31 October 2017 at 02:29, Guido van Rossum wrote: > What's your proposed process to arrive at the list of recommended packages? > I'm thinking it makes the most sense to treat inclusion in the recommended packages list as a possible outcome of proposals for standard library

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread אלעזר
On Tue, Oct 31, 2017 at 12:18 PM Koos Zevenhoven wrote: > On Tue, Oct 31, 2017 at 11:24 AM, Petr Viktorin wrote: > >> On 10/31/2017 09:54 AM, Koos Zevenhoven wrote: >>> >>> >>> ​I wonder if that's more easily understood if you write it along these >>>

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Koos Zevenhoven
On Tue, Oct 31, 2017 at 11:24 AM, Petr Viktorin wrote: > On 10/31/2017 09:54 AM, Koos Zevenhoven wrote: >> >> >> ​I wonder if that's more easily understood if you write it along these >> line(s): >> >>(the_bob,) = ​(name for name in ('bob','fred') if name=='bob') >> > >

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Greg Ewing
(Reposting this to list -- pushed wrong reply button!) Koos Zevenhoven wrote: |defsingle(i): try: ||v =i.next() |||exceptStopIteration:raiseException('No values')|||try: ||i.next() ||exceptStopIteration: ||returnv||else: ||raiseException('Too many values')|||printsingle(name

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Petr Viktorin
On 10/31/2017 09:54 AM, Koos Zevenhoven wrote: On Tue, Oct 31, 2017 at 10:01 AM, Chris Angelico >wrote: On Tue, Oct 31, 2017 at 6:46 PM, Steven D'Aprano > wrote: > On Tue, Oct 31, 2017 at

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Koos Zevenhoven
On Tue, Oct 31, 2017 at 10:01 AM, Chris Angelico wrote: > On Tue, Oct 31, 2017 at 6:46 PM, Steven D'Aprano > wrote: > > On Tue, Oct 31, 2017 at 06:02:34PM +1100, Chris Angelico wrote: > >> One small change: If you use next(i) instead of i.next(), your code

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Chris Angelico
On Tue, Oct 31, 2017 at 6:46 PM, Steven D'Aprano wrote: > On Tue, Oct 31, 2017 at 06:02:34PM +1100, Chris Angelico wrote: >> One small change: If you use next(i) instead of i.next(), your code >> should work on both Py2 and Py3. But other than that, I think it's >> exactly

Re: [Python-ideas] Add single() to itertools

2017-10-31 Thread Koos Zevenhoven
> > > |defsingle(i): try: ||v =i.next() > |||exceptStopIteration:raiseException('No > values')|||try: ||i.next() ||exceptStopIteration: ||returnv||else: > ||raiseException('Too many values')| > ||printsingle(name forname in('bob','fred')ifname=='bob')||| | > > ​Now that looks seriously weird.

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Chris Angelico
On Tue, Oct 31, 2017 at 5:18 PM, Ivan Pozdeev via Python-ideas wrote: >> raise WhitespaceDamagedException from None > > > Thunderbird jerked on me big time. It never did anything like this before! > Switched off Digest mode, individual messages aren't so complicated. > >

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-31 Thread Ivan Pozdeev via Python-ideas
On 31.10.2017 8:37, python-ideas-requ...@python.org wrote: On Tue, Oct 31, 2017 at 3:50 PM, Ivan Pozdeev via Python-ideas wrote: On 30.10.2017 17:32, Guido van Rossum wrote: This is a key example of a case where code speaks. Can you write an implementation of how you

Re: [Python-ideas] Add processor generation to wheel metadata

2017-10-31 Thread Nathaniel Smith
On Mon, Oct 30, 2017 at 5:45 AM, Ivan Pozdeev via Python-ideas wrote: > Generally, packages are compiled for the same processor generation as the > corresponding Python. > But not always -- e.g. NumPy opted for SSE2 even for Py2 to work around some > compiler bug >