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

2017-10-29 Thread Nick Coghlan
On 29 October 2017 at 15:16, Guido van Rossum wrote: > Why? What's wrong with pip install? > At a technical level, this would just be a really thin wrapper around 'pip install' (even thinner than ensurepip in general, since these libraries *wouldn't* be bundled for offline installation, only lis

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

2017-10-29 Thread Antoine Pitrou
On Sun, 29 Oct 2017 17:54:22 +1000 Nick Coghlan wrote: > > The underlying problem is that our reasons for omitting these particular > libraries from the standard library relate mainly to publisher side > concerns like the logistics of ongoing bug fixing and support, *not* end > user concerns like

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

2017-10-29 Thread Stephan Houben
Perhaps slightly off-topic, but I have sometimes wondered if pip could not be made somewhat friendlier for the absolute newbie and the classroom context. Some concrete proposals. 1. Add a function `pip` to the interactive interpreter (similar to how `help` is available). def pip(args):

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 07:54, Nick Coghlan wrote: > On 29 October 2017 at 15:16, Guido van Rossum wrote: >> >> Why? What's wrong with pip install? > > At a technical level, this would just be a really thin wrapper around 'pip > install' (even thinner than ensurepip in general, since these librarie

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 09:51, Antoine Pitrou wrote: > On Sun, 29 Oct 2017 17:54:22 +1000 > Nick Coghlan wrote: >> This means that >> if educators aren't teaching them, or redistributors aren't providing them, >> then they're actively doing their users a disservice > > Which redistributors do not p

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Soni L.
On 2017-10-29 02:28 AM, Nick Coghlan wrote: On 29 October 2017 at 12:25, Brendan Barnwell > wrote: On 2017-10-28 19:13, Soni L. wrote: And to have all cars have engines, you'd do: class Car:     def __init__(self, ???):      

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 10:40, Stephan Houben wrote: > Perhaps slightly off-topic, but I have sometimes wondered if > pip could not be made somewhat friendlier for the absolute newbie > and the classroom context. > > Some concrete proposals. > > 1. Add a function `pip` to the interactive interpreter

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Koos Zevenhoven
(looks like you forgot to reply to the list) On Sun, Oct 29, 2017 at 7:47 AM, Greg Ewing wrote: > Koos Zevenhoven wrote: > >> It looks like you can just as easily drive the car without having the key >> > > That's been found to be a problem in real life, too. > More than one Python-programming c

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

2017-10-29 Thread Wes Turner
On Sunday, October 29, 2017, Paul Moore wrote: > On 29 October 2017 at 10:40, Stephan Houben > wrote: > > Perhaps slightly off-topic, but I have sometimes wondered if > > pip could not be made somewhat friendlier for the absolute newbie > > and the classroom context. > > > > Some concrete propos

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

2017-10-29 Thread Koos Zevenhoven
On Sun, Oct 29, 2017 at 1:44 PM, Paul Moore wrote: > On 29 October 2017 at 09:51, Antoine Pitrou wrote: > > On Sun, 29 Oct 2017 17:54:22 +1000 > > Nick Coghlan wrote: > >> All the proposal does is to suggest taking those existing > recommendations > >> from the documentation and converting them

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Brendan Barnwell
On 2017-10-29 04:44, Soni L. wrote: And this is how you miss the whole point of being able to dynamically add/remove arbitrary components on objects you didn't create, at runtime. Someone gave me this code and told me it explains what I'm trying to do: https://repl.it/NYCF/3 class T: pass

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

2017-10-29 Thread Brendan Barnwell
On 2017-10-29 00:54, Nick Coghlan wrote: The proposal in this thread thus stems from asking the question "Who is going to be best positioned to offer authoritative advice on which third party modules may be preferable to their standard library counterparts for end users of Python?" and answering

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

2017-10-29 Thread Stefan Krah
On Sun, Oct 29, 2017 at 10:10:21AM -0700, Brendan Barnwell wrote: > Only now, since the libraries aren't in the stdlib, the Python devs > won't really be able to do anything to fix that; all they could do > is remove the offending package from the approved list. In practice > I think this is unlik

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Soni L.
On 2017-10-29 02:57 PM, Brendan Barnwell wrote: On 2017-10-29 04:44, Soni L. wrote: And this is how you miss the whole point of being able to dynamically add/remove arbitrary components on objects you didn't create, at runtime. Someone gave me this code and told me it explains what I'm tryi

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

2017-10-29 Thread Guido van Rossum
The two use cases you describe (scripters and teachers) leave me luke-warm -- scripters live in the wild west and can just pip install whatever (that's what it means to be scripting) and teachers tend to want a customized bundle anyway -- let the edu world get together and create their own recommen

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

2017-10-29 Thread Antoine Pitrou
On Sun, 29 Oct 2017 11:44:52 + Paul Moore wrote: > On 29 October 2017 at 09:51, Antoine Pitrou wrote: > > On Sun, 29 Oct 2017 17:54:22 +1000 > > Nick Coghlan wrote: > >> This means that > >> if educators aren't teaching them, or redistributors aren't providing them, > >> then they're acti

[Python-ideas] install pip packages from Python prompt

2017-10-29 Thread Stephan Houben
Hi all, Here is in somewhat more detail my earlier proposal for having in the interactive Python interpreter a `pip` function to install packages from Pypi. Motivation: it appears to me that there is a category of newbies for which "open a shell and do `pip whatever`" is a bit too much. It would

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

2017-10-29 Thread Alex Walters
I have a somewhat better, imo, implementation of a pip object to be loaded into the repl. class pip: def __call__(self, *a, **kw): sys.stderr.write(str(self)) def __repr__(self): return str(self) def __str__(self): return “Please run pip from you

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

2017-10-29 Thread Antoine Rozo
Hi, What would be the difference with current pip module? pip.main(['install', 'some_package']) 2017-10-29 20:26 GMT+01:00 Alex Walters : > I have a somewhat better, imo, implementation of a pip object to be loaded > into the repl. > > > > class pip: > > def __call__(self, *a, **kw): > >

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

2017-10-29 Thread Stephan Houben
Hi Antoine, 2017-10-29 20:31 GMT+01:00 Antoine Rozo : > Hi, > > What would be the difference with current pip module? > pip.main(['install', 'some_package']) > My understanding is that direct use of the `pip` module is explicitly not recommended. Stephan > > 2017-10-29 20:26 GMT+01:00 Alex

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

2017-10-29 Thread Alex Walters
If you are calling pip.main, you know what you are doing, and you know when you have to restart the interpreter or not. An object that displays an error any time you try to use it, instructing a user of the proper way to use pip outside of the interpreter, is intended to catch the newbie mistak

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

2017-10-29 Thread Stephan Houben
Hi Alex, 2017-10-29 20:26 GMT+01:00 Alex Walters : > return “Please run pip from your system command prompt” > > > The target audience for my proposal are people who do not know which part of the sheep the "system command prompt" is. Stephan > > > > > *From:* Python-ideas [mailto:pyth

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

2017-10-29 Thread Alex Walters
Then those users have more fundamental problems. There is a minimum level of computer knowledge needed to be successful in programming. Insulating users from the reality of the situation is not preparing them to be successful. Pretending that there is no system command prompt, or shell, or wh

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 18:56, Guido van Rossum wrote: > The two use cases you describe (scripters and teachers) leave me luke-warm > -- scripters live in the wild west and can just pip install whatever (that's > what it means to be scripting) In my experience, "scripting" *does* include people for

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 19:40, Stephan Houben wrote: > Hi Antoine, > > 2017-10-29 20:31 GMT+01:00 Antoine Rozo : >> >> Hi, >> >> What would be the difference with current pip module? >> pip.main(['install', 'some_package']) > > > > My understanding is that direct use of the `pip` module is explicitl

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

2017-10-29 Thread Alex Walters
Writing scripts for non-developers, in an unmanaged environment (IT cant push a python install to the system) on windows means running pyinstaller et. al., on your script, if it has dependencies or not. Its not worth it to walk someone through a python install to run a script, let alone installing

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

2017-10-29 Thread Paul Moore
On 29 October 2017 at 20:44, Alex Walters wrote: > Writing scripts for non-developers, in an unmanaged environment (IT cant > push a python install to the system) on windows means running pyinstaller > et. al., on your script, if it has dependencies or not. Its not worth it to > walk someone thro

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Nick Coghlan
On 29 October 2017 at 21:44, Soni L. wrote: > ORMs use this kind of descriptor based composition management extensively > in order to reliably model database foreign key relationships in a way > that's mostly transparent to users of the ORM classes. > > > And this is how you miss the whole point

[Python-ideas] Add single() to itertools

2017-10-29 Thread Ivan Pozdeev via Python-ideas
The eponymous C#'s LINQ method, I found very useful in the following, quite recurring use-case: I need to get a specific element from a data structure that only supports search semantics (i.e. returns a sequence/iterator of results). For that, I specify very precise search criteria, so only tha

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

2017-10-29 Thread Nick Coghlan
On 29 October 2017 at 19:51, Antoine Pitrou wrote: > On Sun, 29 Oct 2017 17:54:22 +1000 > Nick Coghlan wrote: > > > > The underlying problem is that our reasons for omitting these particular > > libraries from the standard library relate mainly to publisher side > > concerns like the logistics o

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

2017-10-29 Thread Steven D'Aprano
On Mon, Oct 30, 2017 at 07:14:10AM +0300, Ivan Pozdeev via Python-ideas wrote: > The eponymous C#'s LINQ method, I found very useful in the following, > quite recurring use-case: If I have understood your use-case, you have a function that returns a list of results (or possibly an iterator, or

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

2017-10-29 Thread Nick Coghlan
On 30 October 2017 at 04:56, Guido van Rossum wrote: > The two use cases you describe (scripters and teachers) leave me luke-warm > -- scripters live in the wild west and can just pip install whatever > (that's what it means to be scripting) > For personal scripting, we can install whatever, but

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Wes Turner
On Sunday, October 29, 2017, Nick Coghlan wrote: > On 29 October 2017 at 12:25, Brendan Barnwell > wrote: > >> On 2017-10-28 19:13, Soni L. wrote: >> >>> And to have all cars have engines, you'd do: >>> >>> class Car: >>> def __init__(self, ???): >>> self[Engine] = GasEngine() >>> >>>

Re: [Python-ideas] Composition over Inheritance

2017-10-29 Thread Wes Turner
... But interfaces are clunky and traits are lightweight, and this isn't Go, so we can't just create a class as a namespace full of @staticmethods which accept the relevant object references. * __setattribute__ -> __getitem__, __setitem__ On Monday, October 30, 2017, Wes Turner wrote: > > > On