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

2016-09-01 Thread Stephen J. Turnbull
Guido van Rossum writes: > On Wed, Aug 31, 2016 at 8:57 PM, Stephen J. Turnbull > wrote: > > That seems to be right approach: in system administration, these > > numbers are used mostly to understand resource usage, and > > underestimates are almost never what you want, > > That would see

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

2016-09-01 Thread Random832
On Thu, Sep 1, 2016, at 02:17, Greg Ewing wrote: > I don't think a space should be automatic. The typographical > recommendation is to put a thin non-breaking space between > the value and the unit, but this is not possible with a > monospaced font, so some people might decide that it's > better wi

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

2016-09-01 Thread Greg Ewing
On 2016-08-31 17:19, Guido van Rossum wrote: I guess we need to debate what it should do if the value is way out of range of the SI scale system -- what's it going to do when I pass it 1e50? I propose that it should fall back to 'g' style then, but use "engineering" style where exponents are alw

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

2016-08-31 Thread Greg Ewing
Nikolaus Rath wrote: There's also the important nitpick if 32e7 is best rendered as 320 M or 0.32 G. There's valid applications for both. If you want 0.32 G it's probably because you're showing it alongside other values >= 1 G, so you're really getting into the business of letting the user choo

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

2016-08-31 Thread Greg Ewing
Random832 wrote: One thing to consider is that this is very likely to be used with a unit (e.g. "%hA" intending to display in amperes), so maybe it should put a space after it? Though really people are probably going to want "1 A" vs "1 kA" in that case, rather than "1 A" vs "1kA". I don't thin

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

2016-08-31 Thread Greg Ewing
Steven D'Aprano wrote: On Tue, Aug 30, 2016 at 09:08:01PM -0700, Ken Kundert wrote: My thinking was that r stands for real like f stands for float. The next available letter in the e, f, g sequence would be 'h'. If you want it to stand for something, it could be "human-readable" or "human-o

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

2016-08-31 Thread Ken Kundert
All, Armed with all of your requirements, suggestions and good ideas, I believe I am ready to try to put something together. Thank you all, and once again let me apologize for 'all the drama'. I'll let you know when I have something. -Ken ___ Pytho

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

2016-08-31 Thread Guido van Rossum
On Wed, Aug 31, 2016 at 8:57 PM, Stephen J. Turnbull wrote: > Random832 writes: > > > Also, interesting quirk - it always rounds up. 1025 bytes is "1.1K", and > > in SI mode, 1001 bytes is "1.1k" > > That seems to be right approach: in system administration, these > numbers are used mostly to un

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

2016-08-31 Thread Stephen J. Turnbull
Random832 writes: > Also, interesting quirk - it always rounds up. 1025 bytes is "1.1K", and > in SI mode, 1001 bytes is "1.1k" That seems to be right approach: in system administration, these numbers are used mostly to understand resource usage, and underestimates are almost never what you wan

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

2016-08-31 Thread Nikolaus Rath
On Aug 31 2016, Guido van Rossum wrote: > On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan > wrote: >> On 31 August 2016 at 17:07, Chris Angelico >> wrote: >>> On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert >>> wrote: > What's the mnemonic here? Why "r" for scale factor? My thinkin

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

2016-08-31 Thread Eric V. Smith
On 08/31/2016 01:07 PM, MRAB wrote: > On 2016-08-31 17:19, Guido van Rossum wrote: >> On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan wrote: >>> "h" would be a decent choice - it's not only a continuation of the >>> e/f/g pattern, it's also very commonly used as a command line flag for >>> "human-re

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

2016-08-31 Thread Random832
On Wed, Aug 31, 2016, at 13:43, Random832 wrote: > And the actual -h behavior of those system utilities you mentioned is > "123k", "1.2M", "12M", with the effect being that the value always fits > within a four-character field width, but this isn't a fixed number of > decimal places *or* significan

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

2016-08-31 Thread Random832
On Wed, Aug 31, 2016, at 12:19, Guido van Rossum wrote: > On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan wrote: > > "h" would be a decent choice - it's not only a continuation of the > > e/f/g pattern, it's also very commonly used as a command line flag for > > "human-readable output" in system uti

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

2016-08-31 Thread Nikolaus Rath
On Aug 29 2016, Ken Kundert wrote: > 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

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

2016-08-31 Thread MRAB
On 2016-08-31 17:19, Guido van Rossum wrote: On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan wrote: On 31 August 2016 at 17:07, Chris Angelico wrote: On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert wrote: > What's the mnemonic here? Why "r" for scale factor? My thinking was that r stands for re

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

2016-08-31 Thread MRAB
On 2016-08-31 05:08, Ken Kundert wrote: What's the mnemonic here? Why "r" for scale factor? My thinking was that r stands for real like f stands for float. With the base 2 scale factors, b stands for binary. 'b' already means binary: >>> '{:b}'.format(100) '1100100'

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

2016-08-31 Thread Guido van Rossum
On Wed, Aug 31, 2016 at 5:21 AM, Nick Coghlan wrote: > On 31 August 2016 at 17:07, Chris Angelico wrote: >> On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert >> wrote: >>> > What's the mnemonic here? Why "r" for scale factor? >>> >>> My thinking was that r stands for real like f stands for float. >>>

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

2016-08-31 Thread Erik Bray
On Tue, Aug 30, 2016 at 5:48 AM, Ken Kundert wrote: > 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 >

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

2016-08-31 Thread Nick Coghlan
On 31 August 2016 at 17:07, Chris Angelico wrote: > On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert > wrote: >> > What's the mnemonic here? Why "r" for scale factor? >> >> My thinking was that r stands for real like f stands for float. >> With the base 2 scale factors, b stands for binary. > > "Real

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

2016-08-31 Thread Steven D'Aprano
On Tue, Aug 30, 2016 at 09:08:01PM -0700, Ken Kundert wrote: > > What's the mnemonic here? Why "r" for scale factor? > > My thinking was that r stands for real like f stands for float. Hmmm. Do you know many mathematicians who use SI prefixes when talking about real numbers? I don't think "real

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

2016-08-31 Thread Ken Kundert
Thanks Chris. I had misunderstood Steve's request, and I was thinking of something much more complicated. Your code is very helpful. -Ken On Wed, Aug 31, 2016 at 05:07:11PM +1000, Chris Angelico wrote: > On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert > wrote: > > > What's the mnemonic here? Wh

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

2016-08-31 Thread Chris Angelico
On Wed, Aug 31, 2016 at 2:08 PM, Ken Kundert wrote: > > What's the mnemonic here? Why "r" for scale factor? > > My thinking was that r stands for real like f stands for float. > With the base 2 scale factors, b stands for binary. "Real" has historically often been a synonym for "float", and it do

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

2016-08-31 Thread Paul Moore
On 31 August 2016 at 05:08, Ken Kundert wrote: > Auto-scaling is kind of the point. There is really little need for a special > mechanism if your going to specify the scale factor yourself. > > >>> print('Attenuation = {:.1f} dB at {:r}m.'.format(-13.7, 50e3)) > Attenuation = -13.7 dB at 5

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

2016-08-30 Thread Ken Kundert
> What's the mnemonic here? Why "r" for scale factor? My thinking was that r stands for real like f stands for float. With the base 2 scale factors, b stands for binary. > (1) Why no support for choosing a particular scale? If this only auto-scales, > I'm not interested. Auto-scaling is kind of

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

2016-08-30 Thread Chris Angelico
On Wed, Aug 31, 2016 at 12:05 PM, Steven D'Aprano wrote: > (5) Is this really something that format() needs to understand? We can > get a *much* richer and more powerful interface by turning it into a > generalise numeric pretty-printing library, at the cost of a little less > convenience. Or jus

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

2016-08-30 Thread Steven D'Aprano
On Tue, Aug 30, 2016 at 01:34:27PM -0700, Ken Kundert wrote: > 3. A change to the various string formatting mechanisms to allow outputting > real >numbers with SI scale factors: This is somewhat similar to a library I wrote for formatting bytes: https://pypi.python.org/pypi/byteformat Giv

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

2016-08-30 Thread Barry Warsaw
On Aug 30, 2016, at 02:16 PM, Guido van Rossum wrote: >Given that something like this gets proposed from time to time, I >wonder if it would make sense to actually write up (1) and (2) as a >PEP that is immediately marked rejected. The PEP should make it clear >*why* it is rejected. This would be

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

2016-08-30 Thread Sven R. Kunze
Thanks a lot for this comprehensive summary. :) Find my comments below. On 30.08.2016 22:34, Ken Kundert wrote: Okay, let's try to wrap this up. In summary I proposed three things: 1. A change to the Python lexer to accept SI literal as an alternative, but not replacement to, E-notation. A

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

2016-08-30 Thread Guido van Rossum
Given that something like this gets proposed from time to time, I wonder if it would make sense to actually write up (1) and (2) as a PEP that is immediately marked rejected. The PEP should make it clear *why* it is rejected. This would be a handy reference doc to have around the next time the idea

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

2016-08-30 Thread Paul Moore
On 30 August 2016 at 21:34, Ken Kundert wrote: > So, given all this, I would like to make the following recommendations: > 1. No action should be taken. > 2. The main justification to modifying float() was to make it consistent with >the extended Python language. Without extension 1, this just

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

2016-08-30 Thread Ken Kundert
Okay, let's try to wrap this up. In summary I proposed three things: 1. A change to the Python lexer to accept SI literal as an alternative, but not replacement to, E-notation. As an optional feature, simple units could be added to the end but would be largely ignored. So the following wou

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

2016-08-30 Thread Ken Kundert
Guido, I am in the process of summarizing the discussion as a way of wrapping this up. As part of that I will be making a proposal that I think has a chance of being accepted, and it will largely be what you suggest. -Ken On Tue, Aug 30, 2016 at 11:59:19AM -0700, Guido van Rossum wrote: > On

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

2016-08-30 Thread Guido van Rossum
On Tue, Aug 30, 2016 at 11:48 AM, Ken Kundert wrote: > [...] Similarly when people refer to the length of > the Olympic road race in Rio, they say 56km, not 56000m. However I can't help to point out that if I said the distance to the sun is 149.6 Gm, most people would do a double-take. > This is

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

2016-08-30 Thread Ken Kundert
Steve, Actually I initially asked for the distances in parsecs and was expecting that they would be presented in a convenient format. So, to frame it in terms of your analogy, I ordered a short black and become upset when I am delivered 8oz of coffee in a 55 gallon drum. This seems to be one o

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

2016-08-30 Thread João Santos
On Tue, 30 Aug 2016 at 12:48 Sven R. Kunze wrote: > On 30.08.2016 04:34, David Mertz wrote: > > 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 num

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

2016-08-30 Thread Steven D'Aprano
On Mon, Aug 29, 2016 at 08:48:55PM -0700, Ken Kundert wrote: > >>> print(d_sun.to(u.kpc)) > 4.850441695494146e-09 kpc > > I can see where this can be helpful at times, but it kind of goes against the > spirit of SI scale factors, were you are generally expected to 'normalize' > the > s

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

2016-08-30 Thread Ken Kundert
Chris, I was not able to get an astrophyics example, but I do have a reasonable one that performs a spectral analysis of the output of an analog to digital converter, something radio astronomers are known to do. I am including the code, but it requires a rather large data file to run, which

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

2016-08-30 Thread Sven R. Kunze
On 30.08.2016 04:34, David Mertz wrote: 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

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

2016-08-30 Thread Paul Moore
On 30 August 2016 at 04:19, Ken Kundert wrote: > Do you think there is no value to be able to naturally read and write numbers > with SI scale factors from Python? Or is your issue with something about my > proposal? Ken, Answering these questions from my perspective (and thanks for taking note o

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

2016-08-30 Thread Stephen J. Turnbull
Sven R. Kunze writes: > And now we have '_' in numbers. > > So much for "preferably one way". Poor example. There used to be no way to group long strings of numerals for better readability. Now there is exactly one way. The Zen is not an axe. It's a scalpel. __

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] 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] 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] 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 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 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 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

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] 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] 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] 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 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] 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 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] 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 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 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 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 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 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 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 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] 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 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 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
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 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 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
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-28 Thread Chris Angelico
On Mon, Aug 29, 2016 at 1:29 PM, Ken Kundert wrote: > Because by focusing on the implementation details, we miss the big picture. > We > have already done that, and we ended up going down countless ratholes. They're important ratholes though. Without digging into those questions, all you have i

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

2016-08-28 Thread Nick Coghlan
On 29 August 2016 at 13: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

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

2016-08-28 Thread Chris Angelico
On Mon, Aug 29, 2016 at 1:40 PM, 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 b

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

2016-08-28 Thread Nick Coghlan
On 29 August 2016 at 11:44, Ken Kundert wrote: > When working with a general purpose programming language, the above numbers > become: > > 780kpc -> 7.8e+05 > 108MPa -> 1.08e+08 > 600TW -> 6e+14 > 3.2Gb -> 3.2e+09 > 53pm -> 5.3e-11 > $8G-> 8e+09 A better comparison

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

2016-08-28 Thread Steven D'Aprano
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.8e+05 [...] For the record, I don't know what kpc might mean. "kilo pico spe

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

2016-08-28 Thread Brendan Barnwell
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 one --obvious way to do it." If Python didn't

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

2016-08-28 Thread Ken Kundert
On Mon, Aug 29, 2016 at 12:33:16PM +1000, Chris Angelico wrote: > On Mon, Aug 29, 2016 at 11:44 AM, Ken Kundert > wrote: > > When working with a general purpose programming language, the above numbers > > become: > > > > 780kpc -> 7.8e+05 > > 108MPa -> 1.08e+08 > > 600TW -> 6e+14 > >

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

2016-08-28 Thread Brendan Barnwell
On 2016-08-28 18:44, Ken Kundert wrote: When working with a general purpose programming language, the above numbers become: 780kpc -> 7.8e+05 108MPa -> 1.08e+08 600TW -> 6e+14 3.2Gb -> 3.2e+09 53pm -> 5.3e-11 $8G-> 8e+09 Notice that the numbers become longe

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

2016-08-28 Thread Ken Kundert
> It makes the language needlessly complicated, has no benefit I've discerned > (vs using libraries), and is a magnet for a large class of bugs. Well the comment about bugs in speculation that does not fit with the extensive experience in the electrical engineering community. But other than that,

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

2016-08-28 Thread Bruce Leban
On Sun, Aug 28, 2016 at 6:44 PM, Ken Kundert wrote: > When working with a general purpose programming language, the above numbers > become: > > 780kpc -> 7.8e+05 > 108MPa -> 1.08e+08 > 600TW -> 6e+14 > 3.2Gb -> 3.2e+09 > 53pm -> 5.3e-11 > $8G-> 8e+09 > These are n

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

2016-08-28 Thread MRAB
On 2016-08-29 02:44, Ken Kundert wrote: [snip] The way the scientific and engineering communities predominately write real numbers is by using SI scale factors. These numbers almost always represent physical quantities, so it is common to write the number with scale factor and units. So for e

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

2016-08-28 Thread Chris Angelico
On Mon, Aug 29, 2016 at 12:32 PM, David Mertz wrote: > In fact, at a certain point I proposed that we should deal with rounding > issues by calling the minimum domain specific time unit an attosecond, and > only use integers in using this unit. That wasn't what was adopted, but it > wasn't absurd.

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

2016-08-28 Thread Chris Angelico
On Mon, Aug 29, 2016 at 11:44 AM, Ken Kundert wrote: > When working with a general purpose programming language, the above numbers > become: > > 780kpc -> 7.8e+05 > 108MPa -> 1.08e+08 > 600TW -> 6e+14 > 3.2Gb -> 3.2e+09 > 53pm -> 5.3e-11 > $8G-> 8e+09 > > Notice tha

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

2016-08-28 Thread David Mertz
-1 on Python ever having any syntactic support for SI scale factors. It makes the language needlessly complicated, has no benefit I've discerned (vs using libraries), and is a magnet for a large class of bugs. Btw, the argument below feels dishonest in another respect. Within a domain there is a

[Python-ideas] real numbers with SI scale factors

2016-08-28 Thread Ken Kundert
Wow, things have suddenly turned very negative. I understand that this is very normal for these types of forums where it is easy to lose sight of the big picture. So let me try to refocus this discussion again. MOTIVATION The way the scientific and engineering communities predominately write r