[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
Changes by anthony shaw : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
Changes by anthony shaw : -- pull_requests: +1215 ___ Python tracker ___ ___

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
anthony shaw added the comment: yey! I figured it out!! -- ___ Python tracker ___ ___ Python-bugs-list

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
reproduce this in a REPL for 3.7.0a0, it never gets any further than the grammar or tokenizer phase. -- messages: 291398 nosy: anthonypjshaw priority: normal severity: normal status: open title: Compiler "'await' outside function" error message is unreachable

Function error

2014-06-14 Thread sandhyaranimangipudi
I am new to python, pls help me to resolve the below error def fib(n): ... Print a Fibonacci series up to n. File stdin, line 2 Print a Fibonacci series up to n. ^ IndentationError: expected an indented block --

Re: Function error

2014-06-14 Thread John Ladasky
On Saturday, June 14, 2014 11:17:50 AM UTC-7, sandhyaran...@gmail.com wrote: I am new to python, pls help me to resolve the below error def fib(n): ... Print a Fibonacci series up to n. File stdin, line 2 Print a Fibonacci series up to n.

Re: Function error

2014-06-14 Thread Terry Reedy
On 6/14/2014 2:17 PM, sandhyaranimangip...@gmail.com wrote: I am new to python, pls help me to resolve the below error Please read the nice tutorial, though no necessarily all at once. It explains things like this. def fib(n): ... Print a Fibonacci series up to n. File stdin, line 2

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2010-01-09 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___ ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2010-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Will close this unless there's an outcry of support for exp2 and log2. nirinA, if you're still interested in adding the euler constant, please open another issue. -- status: open - pending ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2010-01-02 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: The last two functions to consider adding are exp2 and log2. Does anyone care about these? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2010-01-02 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Any time I've ever needed log2(x), log(x)/log(2) was sufficient. In Python, exp2(x) can be spelled 2.0**x. What would exp2(x) gain us? -- ___ Python tracker rep...@bugs.python.org

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2010-01-02 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: In Python, exp2(x) can be spelled 2.0**x. What would exp2(x) gain us? Not much, I suspect. :) I'd expect (but am mostly guessing) exp2(x) to have better accuracy than pow(2.0, x) for some math libraries; I'd further guess that it's

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Added erf and erfc in r76879 (trunk), r76880 (py3k). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-19 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Oops. That's r76878 (trunk) and r76879 (py3k). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch to add expm1. Rather than putting the code in pymath.c, which is the wrong place (see issue #7518), I've added a new file Modules/_math.c for this; log1p, atanh, etc. should also eventually be moved from pymath.c into this

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I committed the patch for expm1 in r76861 (trunk) and r76863 (py3k), with one small change: instead of using 2 * exp(x/2) * sinh(x/2), expm1 is now computed using a method due to Kahan that involves only exp and log. This seems a little

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: nirinA: thanks for the erf patch. It's fine as far as it goes; the main technical issue is that the series development only converges at a sensible rate for smallish x; for larger x something more is needed. Here's a prototype patch for

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's the C version. -- Added file: http://bugs.python.org/file15540/erf_c.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: nirinA: thanks for prodding this issue. Yes, it is still alive (just). :) About adding the Euler constant: I agree this should be added. Do you have time to expand your patch to include docs and a test or two? For expm1, I was planning

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: expm1(x) = sinh(x/2)*exp(x/2) Should be 2*sinh(x/2)*exp(x/2). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: lgamma patch committed to trunk (with looser tests) in r76755. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison
nirinA raseliarison nir...@mail.blueline.mg added the comment: having the gamma function, one certainly needs the other Euler constant: C = 0.5772 the C constant is taken from GSL -- Added file: http://bugs.python.org/file15488/pymath.h.diff ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison
nirinA raseliarison nir...@mail.blueline.mg added the comment: for expm1, we use the Taylor development near zero, but we have to precise what means small value for x. here this means abs(x) math.log(2.0). one can also use abs(x) C -- Added file:

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison
nirinA raseliarison nir...@mail.blueline.mg added the comment: finally, for the error function, with the same kind of idea as with expm1, here is a pure python definition these patches are against r27a1:76674 if all these make sense, i'll check for NAN, infinity, test suite... --

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-12-07 Thread nirinA raseliarison
nirinA raseliarison nir...@mail.blueline.mg added the comment: may be some error when i send this the first time, i cannot see the file, so i resend mathmodule.c.diff sorry if you get it twice -- Added file: http://bugs.python.org/file15491/mathmodule.c.diff

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-18 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Verified that r75454 makes the gamma test errors go away on a PPC Mac. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Ned Deily
Ned Deily n...@acm.org added the comment: For the record, these OS X installer build scripts (running on 10.5) results in these gcc options: gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm. It looks as though the gamma computation itself is fine; it's the accuracy check that's going wrong. I'm suspecting an endianness issue and/or a struct module bug. Ned, do you still get these failures with a direct

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: Adding -mno-fused-madd would be worth trying. It usually fixes PPC bugs ;-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: It was a stupid Mark bug. I'd missed out a '' from the struct.unpack call that was translating floats into integers, for the purposes of computing ulps difference. Fixed in r75454 (trunk), r75455 (py3k). Thanks for reporting this, Ned.

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: BTW, the gamma computation shouldn't be at all fragile, unless I've messed up somewhere: the Lanczos sum is evaluated as a rational function in which both numerator and denominator have only positive coefficients, so there's little danger

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-17 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: Mark, you needn't bother: you found the smoking gun already! From your description, I agree it would be very surprising if FMA made a significant difference in the absence of catastrophic cancellation. --

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-16 Thread Ned Deily
Ned Deily n...@acm.org added the comment: FYI, approximately 20 of the gamma test cases fail on PPC Macs. Attached are snippets from regrtest runs with trunk and with py3k, both on a G4 ppc (32-bit) running OS X 10.5. Identical failures for trunk (did not try py3k) were observed on a G3 ppc

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-10-16 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: FYI, mysterious numeric differences on PPC are often due to the C compiler generated code to use the fused multiply-add HW instruction. In which case, find a way to turn that off :-) -- nosy: +tim_one

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: New patch for gamma , with some tweaks: - return exact values for integral arguments: gamma(1) through gamma(23) - apply a cheap correction to improve accuracy of exp and pow computations - use a different form of the reflection

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I'll test your patch on Windows. Are you working against the trunk or the py3k branch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks! The patch is against the trunk. (It doesn't quite apply cleanly to py3k, but the changes needed to make it do so should be minimal.) Hmm. Rereading my previous comment, I seem to have a blindness for negative signs: gamma(x)

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I'm only setup to test the official Windows build setup under PCbuild. I'm not testing the legacy build setups under PC/VC6, PC/VS7.1, or PC/VS8.0. The patch against the trunk failed for PC/VC6/pythoncore.dsp. I don't need

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Many thanks, Daniel. The patch against the trunk failed for PC/VC6/pythoncore.dsp. I don't need that to build, though. I've no idea why that would happen. A line-ending issue, perhaps? If it doesn't stop me committing the change, then

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: gamma5.patch. very minor changes from the last patch: - add (int) cast suggested by Daniel Stutzbach - Misc/NEWS entry - ..versionadded in docs - minor corrections to some comments -- Added file:

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-18 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Here's a more careful patch for just the gamma function. It's a fairly direct implementation of Lanczos' formula, with the choice of parameters (N=13, g=6.024680040776729583740234375) taken from the Boost library. In testing of random

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-05 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Finally got around to looking at this properly. Here's a first attempt at a patch to add gamma, lgamma, erf and erfc to the math module. It uses the pymath.c.diff code from nirinA, and adds docs, tests, and the extra infrastructure needed

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-05-17 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: Removed file: http://bugs.python.org/file10983/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2008-12-05 Thread Mark Dickinson
, we're pretty close to implementing all the functions in C99s math.h. Seems to me that we might as well aim for completeness and implement the whole lot. -- title: Add gamma and error functions to math module - Add gamma function, error functions and other C99 math.h functions to math

Re: round function error???

2008-07-20 Thread Mark Dickinson
On Jul 19, 12:20 am, John Machin [EMAIL PROTECTED] wrote: On Jul 19, 8:05 am, Mark Dickinson [EMAIL PROTECTED] wrote: for more information.  But I'm guessing that you're questioning the fact that a value that's apparently *less* than 3499.35 is rounded up to 3499.4, rather than down to

Re: round function error???

2008-07-20 Thread John Machin
On Jul 21, 12:56 am, Mark Dickinson [EMAIL PROTECTED] wrote: On Jul 19, 12:20 am, John Machin [EMAIL PROTECTED] wrote: On Jul 19, 8:05 am, Mark Dickinson [EMAIL PROTECTED] wrote: for more information. But I'm guessing that you're questioning the fact that a value that's apparently

round function error???

2008-07-18 Thread Anthony
Isn't this a mistake??? round(3499.349439034,44) 3499.3494390340002 round(_,2) 3499.34999 round(_,1) 3499.40001 My Python 2.5.1 spat that out.. -- http://mail.python.org/mailman/listinfo/python-list

Re: round function error???

2008-07-18 Thread Mark Dickinson
On Jul 18, 10:17 pm, Anthony [EMAIL PROTECTED] wrote: Isn't this a mistake??? Which 'this'? That is, what were you expecting? If you're objecting to the fact that the second result produces 3499.34999 instead of 3499.35, then no, that's not a mistake; see

Re: round function error???

2008-07-18 Thread Terry Reedy
Anthony wrote: Isn't this a mistake??? round(3499.349439034,44) 3499.3494390340002 round(_,2) 3499.34999 round(_,1) 3499.40001 My Python 2.5.1 spat that out.. No, round() return binary floats that, in general, cannot represent decimal floats exactly. Formatted

Re: round function error???

2008-07-18 Thread Mark Dickinson
On Jul 18, 11:15 pm, Terry Reedy [EMAIL PROTECTED] wrote: No, round() return binary floats that, in general, cannot represent decimal floats exactly.  Formatted printing gives what you expect.   '%8.2f' % x ' 3499.35' Sure. But it's still true that the second printed value (printed as

2004 example, passing function error

2008-05-13 Thread globalrev
http://linuxgazette.net/109/pramode.html def sqr(x): return x*x ... def cube(x): return x*x*x ... sqr function sqr at 0x402ba10c a = [sqr, cube] a[0](2) def compose(f, g): return f(g(x)) ... compose(sqr, cube, 2) 64 but i get: compose(sqr, cube, 2) Traceback (most recent call last): File

Re: 2004 example, passing function error

2008-05-13 Thread Carsten Haese
globalrev wrote: but it looks like he just copied his shell...has there been a change since 2004 inr egards to how you can pass functions as arguments to functions?? It looks like it's copy/pasted from a shell, but it's not. No past or present Python interpreter could produce an interactive

Re: 2004 example, passing function error

2008-05-13 Thread alex23
On May 14, 11:40 am, globalrev [EMAIL PROTECTED] wrote: so just a mistake on his part? but it looks like he just copied his shell...has there been a change since 2004 inr egards to how you can pass functions as arguments to functions?? Adding the value argument (x) to the compose function