[Python-ideas] Force UTF-8 option regardless locale

2016-08-29 Thread INADA Naoki
On Tue, Aug 30, 2016 at 8:14 AM, Victor Stinner wrote: > > I proposed the idea, but I'm not sure that we can have a single option > for Linux and Windows. Moreover, I never really worked on trying to > implement "-X utf8" on Linux, because it looks like the "misconfigured > system" are less and le

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Nikolaus Rath
On Aug 28 2016, Ken Kundert wrote: > So, in summary, you are suggesting that we tell the scientific and > engineering > communities that we refuse to provide native support for their preferred way > of > writing numbers because: I think you're making some incorrect assumptions here. Who, exa

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Steven D'Aprano
On Mon, Aug 29, 2016 at 04:24:42PM -0700, Ken Kundert wrote: > > [...] > >Her comment: I did not write it for him. > > [...] > > It has been pointed out to me that the above comes off as being condescending > towards Steven, system administrators and language developers in general. For > thi

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread David Mertz
On Mon, Aug 29, 2016 at 1:55 PM, Sven R. Kunze wrote: > There was no reasonable real-world code examples taken from important > projects, that would be significantly improved by underscores in numbers. > I recall dozens of real world examples that came up during the discussion, and have written

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
Nikolaus, I have belatedly realized that this kind of hyperbole is counter productive. So let me back away from that statement and instead try to understand your reasons for not liking the proposal. Do you think there is no value to be able to naturally read and write numbers with SI scale fac

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Nick Coghlan
On 30 August 2016 at 07:40, Steve Dower wrote: > On 29Aug2016 1433, Eric V. Smith wrote: >> >> On 8/29/2016 5:26 PM, Ethan Furman wrote: >>> >>> Update the PEP, then it's a bugfix. ;) >> >> >> Heh. I guess that's true. But it's sort of a big change, so shipping >> beta 1 with the code not agreein

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
Erik, One aspect of astropy.units that differs significantly from what I am proposing is that with astropy.units a user would explicitly specify the scale factor along with the units, and that scale factor would not change even if the value became very large or very small. For example:

Re: [Python-ideas] Force UTF-8 option regardless locale

2016-08-29 Thread Nick Coghlan
On 30 August 2016 at 10:05, INADA Naoki wrote: > On Tue, Aug 30, 2016 at 8:14 AM, Victor Stinner > wrote: >> >> I proposed the idea, but I'm not sure that we can have a single option >> for Linux and Windows. Moreover, I never really worked on trying to >> implement "-X utf8" on Linux, because it

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Nick Coghlan
On 30 August 2016 at 13:48, Ken Kundert wrote: > >>> d_sun = 93e6*u.imperial.mile > >>> print(d_sun.to(u.parsec)) > 4.850441695494146e-06 pc The "imperial.mile" example here highlights one key benefit that expression based approaches enjoy over dedicated syntax: easy access to Python'

Re: [Python-ideas] a multiProcess scheduler

2016-08-29 Thread Thales filizola costa
> > Potentially, but one of the big challenges you'll face is to establish > how it differs from using asyncio in the current process to manage > tasks dispatched to other processes via run_in_executor, and when > specifically it would be useful thing for a developer to have in the > builtin toolki

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
On Mon, Aug 29, 2016 at 01:45:20PM +1000, Steven D'Aprano wrote: > On Sun, Aug 28, 2016 at 08:26:38PM -0700, Brendan Barnwell wrote: > > On 2016-08-28 18:44, Ken Kundert wrote: > > >When working with a general purpose programming language, the above numbers > > >become: > > > > > > 780kpc -> 7.

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Brendan Barnwell
On 2016-08-29 00:07, Ken Kundert wrote: >I completely believe Ken that within a single tightly focussed user >community, using their expected conventions (including SI prefixes) >works really well. But Python users do not belong to a single tightly >focussed user community. You think that Python

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
> There are other languages too that had hexadecimal and octal. > > They've been around in programming languages for decades. > > How many languages have scale factors? > > Does Fortran? Not that I know of. > The reason why hexadecimal and octal are in general purpose languages and real number

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
On Mon, Aug 29, 2016 at 12:18:02AM -0700, Brendan Barnwell wrote: > On 2016-08-29 00:07, Ken Kundert wrote: > > > >I completely believe Ken that within a single tightly focussed user > > > >community, using their expected conventions (including SI prefixes) > > > >works really well. But Python user

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 5:07 PM, Ken Kundert wrote: > > I talked to astrophysicist about your comments, and what she said was: > 1. She would love it if Python had built in support for real numbers with SI >scale factors > 2. I told her about my library for reading and writing numbers with SI

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
> > These do not seem like good reasons for not doing this. > > Not worded the way you have them, no, because you've aimed for an > extremely emotional argument instead of answering concrete questions > like "where's the code that this would improve". Find some real-world > code that would truly b

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Terry Reedy
On 8/28/2016 9:44 PM, Ken Kundert wrote: The way the scientific and engineering communities predominately write real numbers is by using SI scale factors. I don't believe it, not with naked scale factors as you have proposed. I have worked in science and I never saw naked scale factors until

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 7:08 PM, Ken Kundert wrote: >> > These do not seem like good reasons for not doing this. >> >> Not worded the way you have them, no, because you've aimed for an >> extremely emotional argument instead of answering concrete questions >> like "where's the code that this would

Re: [Python-ideas] a multiProcess scheduler

2016-08-29 Thread Nick Coghlan
On 29 August 2016 at 15:53, Thales filizola costa wrote: > Hi Nick, > > I have just checked all the links you posted, they are indeed very > interesting and very efficient. However, I think those are very complicate > in terms of installation and setup, and I still see a lot of usages for a > mult

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Nick Coghlan
On 29 August 2016 at 19:08, Ken Kundert wrote: > Also the interactive environments, such as ipython, need to > adapt. The more this occurs, the better life gets for scientists and > engineers. This theory of change is backwards - we follow IPython and Project Jupyter when it comes to understandi

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread David Mertz
I teach working scientists about numeric computing on a daily basis. There are a few special field where Ken's ideas are the norm, at least in informal notation. The large majority of working scientists would find a syntax change like he proposes an annoyance and nuisance. Alienating and confusing

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Mark Lawrence via Python-ideas
On 29/08/2016 02:44, Ken Kundert wrote: Changing Python so that it understands SI scale factors on real numbers as first class citizens innately requires a change to the base language; it cannot be done solely through libraries. The question before you is, should we do it? No, no, no, if the

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Stephan Houben
Note that the Sage computer algebra system uses Python with some syntactic changes implemented by a "pre-parser". The current proposal could be implemented in a similar way and then integrated in, say, Ipython. If it would prove to be wildly popular, then it would make a stronger case for incorpo

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Mark Lawrence via Python-ideas
On 29/08/2016 13:35, Stephan Houben wrote: Note that the Sage computer algebra system uses Python with some syntactic changes implemented by a "pre-parser". The current proposal could be implemented in a similar way and then integrated in, say, Ipython. If it would prove to be wildly popular, t

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Erik Bray
On Mon, Aug 29, 2016 at 9:07 AM, Ken Kundert wrote: > On Mon, Aug 29, 2016 at 01:45:20PM +1000, Steven D'Aprano wrote: >> On Sun, Aug 28, 2016 at 08:26:38PM -0700, Brendan Barnwell wrote: >> > On 2016-08-28 18:44, Ken Kundert wrote: >> > >When working with a general purpose programming language, t

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Nick Coghlan
On 29 August 2016 at 22:55, Mark Lawrence via Python-ideas wrote: > As iPython is a core part of scipy, which I linked above, why would the > developers want to incorporate this suggestion? I'd have also thought that > if this idea was to be "wildly popular" it would have been done years ago. Wh

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Erik Bray
On Mon, Aug 29, 2016 at 3:05 PM, Erik Bray wrote: > On Mon, Aug 29, 2016 at 9:07 AM, Ken Kundert > wrote: >> On Mon, Aug 29, 2016 at 01:45:20PM +1000, Steven D'Aprano wrote: >>> On Sun, Aug 28, 2016 at 08:26:38PM -0700, Brendan Barnwell wrote: >>> > On 2016-08-28 18:44, Ken Kundert wrote: >>> > >

Re: [Python-ideas] A proposal to rename the term "duck typing"

2016-08-29 Thread Erik Bray
On Sun, Aug 28, 2016 at 7:41 PM, Bruce Leban wrote: > > > On Sunday, August 28, 2016, ROGER GRAYDON CHRISTMAN wrote: >> >> >> We have a term in our lexicon "duck typing" that traces its origins, in >> part to a quote along the lines of >> "If it walks like a duck, and talks like a duck, ..." >> >

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 10:55 PM, Mark Lawrence via Python-ideas wrote: > I'd have also thought that if this idea was to be "wildly popular" it would > have been done years ago. Here's my question, though, if you want to see the lanterns so badly, why haven't you gone before? -- Flynn Rider, to R

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Steven D'Aprano
On Mon, Aug 29, 2016 at 02:35:26PM +0200, Stephan Houben wrote: > Note that the Sage computer algebra system uses Python with some syntactic > changes implemented by a "pre-parser". > > The current proposal could be implemented in a similar way and then > integrated in, say, Ipython. > > If it wo

Re: [Python-ideas] a multiProcess scheduler

2016-08-29 Thread Sven R. Kunze
On 29.08.2016 05:32, Nick Coghlan wrote: (Alternatively, if the answer the interviewer is looking for is "I wouldn't, I would use...", then it may be an unfair "Gotcha!" question, and those aren't cool either, since they expect the interviewee to be able to read the interviewer's mind, rather tha

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Sven R. Kunze
On 29.08.2016 05:40, Brendan Barnwell wrote: On 2016-08-28 20:29, Ken Kundert wrote: What is wrong with have two ways of doing things? We have many ways of specifying the value of the integer 16: 0b1, 0o20, 16, 0x10, 16L, Zen of Python: "There should be one-- and preferably only

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Sven R. Kunze
On 29.08.2016 11:37, Chris Angelico wrote: That's why I keep asking you for code examples. Real-world code, taken from important projects, that would be significantly improved by this proposal. There was no reasonable real-world code examples taken from important projects, that would be signif

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Eric V. Smith
On 8/23/2016 8:18 AM, Nick Coghlan wrote: On 21 August 2016 at 03:32, Eric V. Smith wrote: If anything, I'd make it an error to have any backslashes inside the brackets of an f-string for 3.6. We could always remove this restriction at a later date. +1 for this if you can find a way to do it

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Sven R. Kunze
I didn't follow the previous discussion so far, so excuse me if I repeat something somebody already mentioned. But these are intriguing points you made here. On 29.08.2016 09:31, Ken Kundert wrote: The reason why hexadecimal and octal are in general purpose languages and real numbers with SI s

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Eric V. Smith
Oops, I meant beta 1 where I said alpha 1. Eric. On 8/29/2016 5:12 PM, Eric V. Smith wrote: On 8/23/2016 8:18 AM, Nick Coghlan wrote: On 21 August 2016 at 03:32, Eric V. Smith wrote: If anything, I'd make it an error to have any backslashes inside the brackets of an f-string for 3.6. We coul

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Ethan Furman
On 08/29/2016 02:16 PM, Eric V. Smith wrote: I've been looking at this, and I agree it's the best thing to do, for now (and possibly forever). I'm just not convinced I can get it done before alpha 1. Isn't the f-string feature already in place? Update the PEP, then it's a bugfix. ;) -- ~Et

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Alex Rudy
> On Aug 29, 2016, at 06:08, Erik Bray wrote: > > On Mon, Aug 29, 2016 at 3:05 PM, Erik Bray > wrote: >> On Mon, Aug 29, 2016 at 9:07 AM, Ken Kundert >> wrote: >>> On Mon, Aug 29, 2016 at 01:45:20PM +1000, Steven D'Aprano wrote: On Sun, Aug 28, 2016 at 08:26:

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Eric V. Smith
On 8/29/2016 5:26 PM, Ethan Furman wrote: On 08/29/2016 02:16 PM, Eric V. Smith wrote: I've been looking at this, and I agree it's the best thing to do, for now (and possibly forever). I'm just not convinced I can get it done before alpha 1. Isn't the f-string feature already in place? Yes

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Eric V. Smith
On 8/29/2016 5:40 PM, Steve Dower wrote: On 29Aug2016 1433, Eric V. Smith wrote: On 8/29/2016 5:26 PM, Ethan Furman wrote: Update the PEP, then it's a bugfix. ;) Heh. I guess that's true. But it's sort of a big change, so shipping beta 1 with the code not agreeing with the PEP rubs me the wr

Re: [Python-ideas] Let’s make escaping in f-literals impossible

2016-08-29 Thread Steve Dower
On 29Aug2016 1433, Eric V. Smith wrote: On 8/29/2016 5:26 PM, Ethan Furman wrote: Update the PEP, then it's a bugfix. ;) Heh. I guess that's true. But it's sort of a big change, so shipping beta 1 with the code not agreeing with the PEP rubs me the wrong way. Or, I could stop worrying and ty

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Ken Kundert
> I talked to astrophysicist about your comments, and what she said was: > 1. She would love it if Python had built in support for real numbers with SI >scale factors > 2. I told her about my library for reading and writing numbers with SI scale >factors, and she was much less enthusiasti