Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-15 Thread Nick Coghlan
On 14 March 2018 at 15:20, Chris Billington wrote: > > I wonder if there's any reason something like this shouldn't be built into > Python's default import system. > There are two main challenges with enforcing such a check, one affecting end users in general, one affecting standard library maint

Re: [Python-ideas] Syntax idea for 2D lists\arrays

2018-03-15 Thread Stephan Houben
I'd just do this, which works today: == import numpy import io ar = numpy.loadtxt(io.StringIO(""" 1 5 9 155 53 44 44 34 """)) == Of course, this is only worth the trouble if you are somehow loading a very large matrix. (And then, are you sure you want to

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-15 Thread George Fischhof
2018-03-13 13:17 GMT+01:00 Steven D'Aprano : > On Mon, Mar 12, 2018 at 09:57:32PM +0100, George Fischhof wrote: > > > Right now we have several modules that contain functions related > > to file-system operations mainly the os, pathlib and shutil. > > For beginners it is quite hard to remember whe

Re: [Python-ideas] Syntax idea for 2D lists\arrays

2018-03-15 Thread Mikhail V
On Thu, Mar 15, 2018 at 6:15 AM, Steven D'Aprano wrote: > On Thu, Mar 15, 2018 at 01:32:35AM +0100, Mikhail V wrote: > > Using spaces to separate items has the fatal flaw that it cannot > distinguish > > x - y 0 # two items, the expression `x - y` and the integer 0 > > from: > >x - y 0

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-15 Thread Chris Angelico
On Fri, Mar 16, 2018 at 12:38 AM, George Fischhof wrote: > > > " if new file functions are added, they will go only in pathlib, > which makes pathlib effectively mandatory;" > Yes but I think this part of the evolution: slowly everyone will shift to > pathlib, > and being mandatory is true for t

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-15 Thread Antoine Pitrou
On Fri, 16 Mar 2018 04:15:11 +1100 Chris Angelico wrote: > On Fri, Mar 16, 2018 at 12:38 AM, George Fischhof wrote: > > > > > > " if new file functions are added, they will go only in pathlib, > > which makes pathlib effectively mandatory;" > > Yes but I think this part of the evolution: slowly

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-15 Thread Chris Angelico
On Fri, Mar 16, 2018 at 4:48 AM, Antoine Pitrou wrote: > On Fri, 16 Mar 2018 04:15:11 +1100 > Chris Angelico wrote: >> On Fri, Mar 16, 2018 at 12:38 AM, George Fischhof wrote: >> > >> > >> > " if new file functions are added, they will go only in pathlib, >> > which makes pathlib effectively m

[Python-ideas] Adding quantile to the statistics module

2018-03-15 Thread PLIQUE Guillaume
Hello everyone, Sorry if this subject has already been covered in the mailing list but I could not find it. My question is very simple: should the `quantile` function be added to python `statistics` module. I was very happy to learn the existence of this module in python3 only to later be forced

Re: [Python-ideas] Adding quantile to the statistics module

2018-03-15 Thread Nathaniel Smith
On Thu, Mar 15, 2018 at 12:39 PM, PLIQUE Guillaume wrote: > Hello everyone, > > Sorry if this subject has already been covered in the mailing list but I > could not find it. > > My question is very simple: should the `quantile` function be added to > python `statistics` module. This seems like a

Re: [Python-ideas] Adding quantile to the statistics module

2018-03-15 Thread Steven D'Aprano
On Thu, Mar 15, 2018 at 02:42:01PM -0700, Nathaniel Smith wrote: > This seems like a reasonable idea to me -- but be warned that there > are actually quite a few slightly-different definitions of "quantile" > in use. R supports 9 different methods of calculating quantiles Indeed. I've been consid

Re: [Python-ideas] Descouraging the implicit string concatenation

2018-03-15 Thread Rob Cliffe via Python-ideas
On 14/03/2018 17:57, Chris Angelico wrote: On Thu, Mar 15, 2018 at 12:40 AM, Søren Pilgård wrote: Of course you can always make error, even in a single letter. But I think there is a big difference between mixing up +-/* and ** where the operator is in "focus" and the implicit concatenation w

Re: [Python-ideas] Adding quantile to the statistics module

2018-03-15 Thread Stephen J. Turnbull
Steven D'Aprano writes: > Indeed. I've been considering quantiles and quartiles for a long time, > and I've found at least ten different definitions for quantiles and > sixteen for quartiles. My take is "don't let the perfect be the enemy of the good." Quantiles are used a lot for "governmen