[issue23545] Turn on extra warnings on GCC

2016-08-11 Thread Martin Panter
Martin Panter added the comment: I didn’t look too closely, but I did see that _ssl_locks_count is unsigned int. I was compiling for x86-64 Linux, where int is 32 bits and size_t is 64. So maybe GCC was optimizing the (size_t) cast away, and then rightfully warning that the largest unsigned

Re: Asynchronous programming

2016-08-11 Thread Paul Rudin
Steven D'Aprano writes: > Thanks to everyone who has answered, I think I'm slowly starting to get it > now. Let's see if we can come up with a toy example that doesn't involve > low-level socket programming :-) > > Let me simulate a slow function call: > > > import

[issue23545] Turn on extra warnings on GCC

2016-08-11 Thread Antti Haapala
Antti Haapala added the comment: I don't think adding -Wno-type-limits is a good idea. The good question is how that can be happening, e.g. how PY_SSIZE_T_MAX divided by sizeof anything can be *more* than max(size_t)? E.g now that I stare at the code, *that* warning should be impossible if

[issue26081] Implement asyncio Future in C to improve performance

2016-08-11 Thread INADA Naoki
INADA Naoki added the comment: Implemented FutureIter -- Added file: http://bugs.python.org/file44081/futures.patch ___ Python tracker ___

Re: Call for Assistance

2016-08-11 Thread Paul Rubin
Charles Ross writes: > Well, I’ve been convinced. The license for the book is now Creative > Commons Attribution-ShareAlike. That means you can post it on wikibooks.org and let people edit it directly, if you want. Wikibooks is nowhere near as crazy as wikipedia. --

Re: Asynchronous programming

2016-08-11 Thread Paul Rubin
Steven D'Aprano writes: > How do I write work() so that it cooperatively multi-tasks with other ... > threads? processes? what the hell do we call these things? What does this > example become in the asynchronous world? If it's heavily computational then you have to

Re: Call for Assistance

2016-08-11 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 1:09:31 PM UTC+12, Charles Ross wrote: > Well, I’ve been convinced. The license for the book is now Creative > Commons Attribution-ShareAlike. Great. :) That’s the one to use if you are worried about companies who want something for nothing coming in and ripping

Re: Call for Assistance

2016-08-11 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 3:42:39 AM UTC+12, Reto Brunner wrote: > What on earth isn't "free" enough about > > You are free to: > Share — copy and redistribute the material in any medium or format No you are not. A court has ruled

Re: python 3.5.2 lounch: api-ms-win-crt-runtime-l1-1-0.dll is missing ?

2016-08-11 Thread Lawrence D’Oliveiro
On Tuesday, August 9, 2016 at 6:46:52 AM UTC+12, Joaquin Alzola wrote: > This email is confidential and may be subject to privilege. If you are not > the intended recipient, please do not copy or disclose its content but > contact the sender immediately upon receipt. Consider yourself contacted!

[issue27506] make bytes/bytearray delete a keyword argument

2016-08-11 Thread Xiang Zhang
Xiang Zhang added the comment: So let's do a simple benchmark. # without patch ./python -m timeit -s 'string=bytes(range(256));table=bytes(range(255, -1, -1));delete=b"abcdefghijklmn"' 'string.translate(table, delete)' 100 loops, best of 3: 0.55 usec per loop # with patch ./python -m

[issue1732367] Document the constants in the socket module

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Issue 12887 is open to add explanations of the SO_* constants -- dependencies: +Documenting all SO_* constants in socket module ___ Python tracker

[issue12887] Documenting all SO_* constants in socket module

2016-08-11 Thread Martin Panter
Martin Panter added the comment: See also Issue 27409, where I am proposing to list the SO_* and other constants by name (with associated Python version and whether they are missing on some platforms), but without descriptions. -- nosy: +martin.panter

[issue27348] traceback (and threading) drops exception message

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Have you had any luck reviewing this Robert? -- ___ Python tracker ___ ___

Re: Asynchronous programming

2016-08-11 Thread Lawrence D’Oliveiro
On Friday, August 12, 2016 at 2:25:05 AM UTC+12, Terry Reedy wrote: > When I read something like "Python finally acquired an event loop in > 3.4" I wonder where people have been. The tk event loop has been in > Python perhaps for 2 decades... As was pointed out to me just a few days ago,

[issue12345] Add math.tau

2016-08-11 Thread Lisa Roach
Lisa Roach added the comment: I've updated the test to assert tau is equal to 2*math.pi, as well as updated the docs and cmath. Let me know if I have made any errors! -- nosy: +lisroach Added file: http://bugs.python.org/file44080/tau3.diff ___

[issue27614] Race in test_docxmlrpc.py

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Thanks for the explanation. It seems a bit strange that the server thread was running so slow while the main thread did one thousand polls over at least one second. Perhaps there is a blocking DNS call hidden somewhere in it somewhere? In any case, I am pretty

[issue16764] Make zlib accept keyword-arguments

2016-08-11 Thread Xiang Zhang
Xiang Zhang added the comment: OK. Simplest test with positional arguments. Without patch: ./python -m timeit -s 'import zlib; a = zlib.compress(b"abcdefghijklmnopqrstuvwxyz")' 'zlib.decompress(a, 15, 16384)' 100 loops, best of 3: 0.841 usec per loop ./python -m timeit -s 'import zlib; a

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Lawrence D’Oliveiro
On Friday, August 12, 2016 at 1:28:04 AM UTC+12, Cecil Westerhof wrote: > As I understood it getopt is the way to get the parameters for your > script. But at the moment it looks a bit like overkill, my script does > not have much parameters as parameter_error shows: That’s fine. But your

[issue25825] AIX shared library extension modules installation broken

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Patch1 looks fine to me, though I will have to rely on you people to verify that it does what it’s supposed to. Do you want me to commit it straight away, or wait for your follow-up patch? -- ___ Python tracker

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Both parts of your commit seem to have helped. However I found two failures still happening, and one new failure: 1. Casablanca and El_Aaiun still failing since the original commit:

[issue27181] Add geometric mean to `statistics` module

2016-08-11 Thread Martin Panter
Martin Panter added the comment: Tests fail on a Power PC buildbot: http://buildbot.python.org/all/builders/PPC64LE%20Fedora%203.x/builds/1476/steps/test/logs/stdio == FAIL: testExactPowers (test.test_statistics.Test_Nth_Root)

Re: Asynchronous programming

2016-08-11 Thread Chris Angelico
On Fri, Aug 12, 2016 at 10:08 AM, Steven D'Aprano wrote: > Let me simulate a slow function call: > > > import random, time > > def work(id): > print("starting with id", id) > workload = random.randint(5, 15) > for i in range(workload): >

[issue12345] Add math.tau

2016-08-11 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW I don't plan to have more constants there, at the current rate we'll be fine for centuries. :-) What worries me more is proposals to add Python functions to math... --Guido (mobile) -- ___ Python tracker

Re: Asynchronous programming

2016-08-11 Thread Steven D'Aprano
Thanks to everyone who has answered, I think I'm slowly starting to get it now. Let's see if we can come up with a toy example that doesn't involve low-level socket programming :-) Let me simulate a slow function call: import random, time def work(id): print("starting with id", id)

Re: A strange list concatenation result

2016-08-11 Thread Steven D'Aprano
Note that your subject line is wrong. You are not doing list concatenation. Unfortunately, for technical and optimization reasons, the += assignment operator for lists is in-place, which means that it is NOT the same as ordinary list concatenation + operator. It is equivalent to calling the

[issue27506] make bytes/bytearray delete a keyword argument

2016-08-11 Thread Martin Panter
Martin Panter added the comment: I agree it would be worth checking for a slowdown. As well as giving the option of omitting the table argument, it would make call sites easier to read. It would avoid suggesting that the first argument is translated to the second, like maketrans(). data =

OT Winmx works again

2016-08-11 Thread Seymore4Head
-- https://mail.python.org/mailman/listinfo/python-list

Re: Generate reports in Python

2016-08-11 Thread Lawrence D’Oliveiro
On Thursday, August 11, 2016 at 8:30:42 PM UTC+12, wxjm...@gmail.com wrote: > I do not see to much how a library can beat that approach, unless it > duplicates what TeX does. TEX may be fine for more free-form text, but often reports take a more structured layout than that--fixed columns etc.

Re: A strange list concatenation result

2016-08-11 Thread Gary Herron
On 08/11/2016 03:06 PM, Mok-Kong Shen wrote: def test(list1,list2): list1+=[4,5,6] list2=list2+[4,5,6] print("inside ",list1,list2) return # With list1=list2=[1,2,3] test(list1,list2) print("outside",list1,list2) # I got the following: # inside [1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6,

[issue12345] Add math.tau

2016-08-11 Thread Aaron Meurer
Aaron Meurer added the comment: Emanuel Barry, that is both untrue and irrelevant (sorry to be blunt, but that's a total straw man on my and I believe other's argument). The fact that the only mathematical constants in math are pi and e (nan and inf aren't really "mathematical" constants)

[issue12345] Add math.tau

2016-08-11 Thread Guido van Rossum
Guido van Rossum added the comment: Let those other libraries follow. -- ___ Python tracker ___ ___

A strange list concatenation result

2016-08-11 Thread Mok-Kong Shen
def test(list1,list2): list1+=[4,5,6] list2=list2+[4,5,6] print("inside ",list1,list2) return # With list1=list2=[1,2,3] test(list1,list2) print("outside",list1,list2) # I got the following: # inside [1, 2, 3, 4, 5, 6] [1, 2, 3, 4, 5, 6, 4, 5, 6] # outside [1, 2, 3, 4, 5, 6] [1, 2,

[issue12345] Add math.tau

2016-08-11 Thread Emanuel Barry
Emanuel Barry added the comment: I think that whether or not something is trivial doesn't really correlate to whether or not it has its place in the language. After all, `math.pi` is 3.1416, and most people using pi will not worry about more than 4 decimal digits. Those who do are presumably

[issue27506] make bytes/bytearray delete a keyword argument

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyArg_ParseTupleAndKeywords can be slower than PyArg_ParseTuple even for positional arguments. We need benchmarking results (especially after committing a patch for issue27574). What is the purpose of adding support of the delete argument as keyword

Re: ctypes And The WACAH Principle

2016-08-11 Thread MRAB
On 2016-08-11 20:41, Roel Schroeven wrote: Lawrence D’Oliveiro schreef op 2016-08-10 03:45: ... so WACAH very much applies here. Pardon my ignorance, but what is the WACAH Principle? I believe he means "€œWe're All Consenting Adults Here". (I don't think I've ever seen that acronym before.)

[issue23545] Turn on extra warnings on GCC

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just add -Wno-type-limits. -- ___ Python tracker ___ ___ Python-bugs-list

[issue16764] Make zlib accept keyword-arguments

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Xiang Zhang, could you please provide results of benchmarking zlib.decompress and decompressobj.decompress in simplest case with and without the patch? PyArg_ParseTupleAndKeywords can be slower than PyArg_ParseTuple even for positional arguments, and we

[issue12345] Add math.tau

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: Aaron, I may be wrong, but I understood this to be something like: >>> from __future__ import barry_as_FLUFL >>> 3 <> 10 True I *do* hope sympy supports that! :-) -- nosy: +skrah ___ Python tracker

[issue27128] Add _PyObject_FastCall()

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Do you suggest to not add these 2 new functions? Yes, I suggest to not add them. The API for calling is already too large. Internally we can directly use _PyObject_FastCall(), and third party code should get benefit from optimized

[issue27739] add math.sign/signum

2016-08-11 Thread R. David Murray
R. David Murray added the comment: This has been previously discussed and rejected, in issue 829370. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> math.signum(int) ___ Python tracker

[issue12345] Add math.tau

2016-08-11 Thread Aaron Meurer
Aaron Meurer added the comment: I also wonder, if math will be gaining constants that no one uses like tau, if it will also gain constants that people actually do use (currently math just has pi, e, inf, and nan). [i for i in dir(numpy) if isinstance(getattr(numpy, i), float)] reveals

Re: ctypes And The WACAH Principle

2016-08-11 Thread Roel Schroeven
Lawrence D’Oliveiro schreef op 2016-08-10 03:45: ... so WACAH very much applies here. Pardon my ignorance, but what is the WACAH Principle? -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven --

Re: What's the best way to minimize the need of run time checks?

2016-08-11 Thread Russell Owen
On 8/10/16 3:44 PM, Juan Pablo Romero Méndez wrote: As to why I asked that, there are several reasons: I have a very concrete need right now to find pragmatic ways to increase code quality, reduce number of defects, etc. in a Python code base. But also I want to understand better the mind set

[issue27741] datetime.datetime.strptime functionality description incorrect

2016-08-11 Thread Nicholas Colclasure
New submission from Nicholas Colclasure: The datetime.datetime.strptime documentation states that it is equivalent to datetime(*(time.strptime(date_string, format)[0:6])), but the time.struct_time returned by time.strptime does not include microseconds, implying that datetime's strptime would

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2016-08-11 Thread Kay Hayen
Kay Hayen added the comment: This also affects Python2.7.12 on Windows with latest MinGW. I think something similar needs to be added for GCC version check: /* VS 2010 and above already defines hypot as _hypot */ #if _MSC_VER < 1600 #define hypot _hypot #endif Not sure which gcc version first

[issue12345] Add math.tau

2016-08-11 Thread Aaron Meurer
Aaron Meurer added the comment: If this is implemented, it would be (as far as I can tell) the only thing in the math module that isn't also implemented in any of the standard external math libraries. None of numpy, scipy, sympy, or mpmath implement tau (if I'm missing one that others think

[issue12345] Add math.tau

2016-08-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch needs a documentation update, by the way. -- ___ Python tracker ___

[issue12345] Add math.tau

2016-08-11 Thread Aaron Meurer
Changes by Aaron Meurer : -- nosy: +Aaron.Meurer ___ Python tracker ___ ___

[issue12345] Add math.tau

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general, the volume, in n-dimensional Euclidean space, of the unit n-ball, is given by V_n = pi**(n/2) / gamma(n/2+1) or V_n = (tau/2)**(n/2) / gamma(n/2+1) -- ___ Python tracker

[issue12345] Add math.tau

2016-08-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 11/08/2016 20:07, Tim Peters a écrit : > > For those insisting that tau is somehow unnatural, just consider > that the volume of a sphere with radius r is 2*tau/3*r**3 - the formula using > pi instead is just plain impossible to remember ;-) Thank you, I'm

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-11 Thread Xiang Zhang
New submission from Xiang Zhang: I think the doc of Py_CompileStringExFlags has two flaws: 1. Py_CompileStringExFlags should be replaced by Py_CompileStringObject from the context. Py_CompileStringExFlags in the context is meaningless. 2. *filename* is a byte string that should be decoded but

[issue12345] Add math.tau

2016-08-11 Thread Evelyn Mitchell
Changes by Evelyn Mitchell : -- nosy: -Evelyn Mitchell ___ Python tracker ___ ___

[issue12345] Add math.tau

2016-08-11 Thread Tim Peters
Tim Peters added the comment: For those insisting that tau is somehow unnatural, just consider that the volume of a sphere with radius r is 2*tau/3*r**3 - the formula using pi instead is just plain impossible to remember ;-) -- ___ Python tracker

[issue27739] add math.sign/signum

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: copysign() is part of the standard C maths library (that is why it was added to the math module). sgn/sign/signum was used in old languages that didn't have copysign() (Basic, Pascal, etc). -- ___ Python tracker

Re: Print function not working

2016-08-11 Thread Michael Selik
On Thu, Aug 11, 2016 at 1:38 PM MRAB wrote: > On 2016-08-11 18:18, Chris Angelico wrote: > > On Fri, Aug 12, 2016 at 3:03 AM, Atri Mahapatra > > wrote: > >> I have installed IDLE 3.5.1 and wrote the following to check if print > is working.

Re: Asynchronous programming

2016-08-11 Thread Paul Rubin
Steven D'Aprano writes: > But what's the point in doing it asynchronously if I have to just wait for > it to complete? > begin downloading in an async thread > twiddle thumbs, doing nothing > process download Suppose the remote server is overloaded so it sends

[issue12345] Add math.tau

2016-08-11 Thread Vedran Čačić
Vedran Čačić added the comment: Guido once again shows he is not a mathematicians (honestly, most of the "arguments" for tau are plain nonsense), but he is a fantastic popularizer. I (and most of the other professional mathematicians) will love Python a tiny bit less, but a horde of people

Re: Print function not working

2016-08-11 Thread MRAB
On 2016-08-11 18:18, Chris Angelico wrote: On Fri, Aug 12, 2016 at 3:03 AM, Atri Mahapatra wrote: I have installed IDLE 3.5.1 and wrote the following to check if print is working. When it runs, I do not see anything is printed: class Base: #{ def __init__( self

Re: Print function not working

2016-08-11 Thread Peter Otten
Atri Mahapatra wrote: > I have installed IDLE 3.5.1 and wrote the following to check if print is > working. When it runs, I do not see anything is printed: > > class Base: #{ > def __init__( self ): #{ > print("Hello, world: \n\n"); > > #} > > #} > > > if ( __name__

[issue27739] add math.sign/signum

2016-08-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: If this is added, should this signum function be the two value version that returns 1 for zero, or the three value version that returns 0? Should it distinguish between signed zeroes +0.0 and -0.0? What should it do for NANs (raise, return a NAN, copy the

Re: Print function not working

2016-08-11 Thread Chris Angelico
On Fri, Aug 12, 2016 at 3:03 AM, Atri Mahapatra wrote: > I have installed IDLE 3.5.1 and wrote the following to check if print is > working. When it runs, I do not see anything is printed: > > class Base: #{ > def __init__( self ): #{ > print("Hello, world:

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-11 Thread Ben Hoyt
Ben Hoyt added the comment: Removing that whole example sounds good to me, thanks. -- ___ Python tracker ___

[issue27739] add math.sign/signum

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: sgn(x) is the same as copysign(1.0, x). The math module doesn't support complex numbers and shouldn't. -- ___ Python tracker

Print function not working

2016-08-11 Thread Atri Mahapatra
I have installed IDLE 3.5.1 and wrote the following print command to see if it is working. When I ran the code nothing is printed. Can you please point the reason- anything wrong with the code? class Base: #{ def __init__( self ): #{ print("Hello, world: \n\n"); #}

Print function not working

2016-08-11 Thread Atri Mahapatra
I have installed IDLE 3.5.1 and wrote the following to check if print is working. When it runs, I do not see anything is printed: class Base: #{ def __init__( self ): #{ print("Hello, world: \n\n"); #} #} if ( __name__ == " __main__"): #{ root = Base(); #} Can

Re: Asynchronous programming

2016-08-11 Thread Chris Angelico
On Fri, Aug 12, 2016 at 12:55 AM, Steven D'Aprano wrote: > On Thu, 11 Aug 2016 02:41 pm, Chris Angelico wrote: > >> Consider these three ways of doing a database transaction: >> >> def synchronous(id): >> trn = conn.begin_transaction() >> trn.execute("select

Re: Asynchronous programming

2016-08-11 Thread Steven D'Aprano
On Thu, 11 Aug 2016 03:34 pm, Paul Rudin wrote: > Steven D'Aprano writes: > >> >> Is there a good beginner's tutorial introducing the basics of >> asynchronous programming? Starting with, why and where would you use it? > > You could do worse than watch Dave

[issue27739] add math.sign/signum

2016-08-11 Thread Ankur Dedania
Ankur Dedania added the comment: sign/signum isn't the same as copysign, and doesn't support complex numbers -- ___ Python tracker ___

Re: Asynchronous programming

2016-08-11 Thread Paul Rudin
Steven D'Aprano writes: > > But what's the point in doing it asynchronously if I have to just wait for > it to complete? > > begin downloading in an async thread > twiddle thumbs, doing nothing > process download If you have nothing else to do, then there's no

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Cecil Westerhof
On Thursday 11 Aug 2016 17:15 CEST, Cecil Westerhof wrote: > On Thursday 11 Aug 2016 16:29 CEST, Peter Otten wrote: > >> Cecil Westerhof wrote: >> >>> It has been a while since I worked with Python. I wanted to get >>> some stats about the idle time of my computer, so that was a good >>> moment

[issue27739] add math.sign/signum

2016-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See math.copysign(). https://docs.python.org/3/library/math.html#math.copysign -- nosy: +serhiy.storchaka ___ Python tracker

Re: Advice on optimizing a Python data driven rules engine

2016-08-11 Thread Chris Angelico
On Fri, Aug 12, 2016 at 12:56 AM, Malcolm Greene wrote: > Looking for some advice on how to optimize the BOILERPLATE portions of > the following type of code. There's an awful lot of dot dereferencing > going on. One thought was to pass in the values being dereferenced as >

Re: Asynchronous programming

2016-08-11 Thread Jussi Piitulainen
Michael Selik writes: > On Thu, Aug 11, 2016 at 11:46 AM Michael Selik > wrote: > >> On Thu, Aug 11, 2016 at 11:01 AM Steven D'Aprano < >> steve+pyt...@pearwood.info> wrote: >> >>> That ... looks wrong. You're taking something which looks like a

[issue27739] add math.sign/signum

2016-08-11 Thread Ankur Dedania
New submission from Ankur Dedania: Add a new function to the math module sign/signum https://en.wikipedia.org/wiki/Sign_function -- messages: 272459 nosy: AnkurDedania priority: normal severity: normal status: open title: add math.sign/signum type: enhancement versions: Python 3.6

Re: Asynchronous programming

2016-08-11 Thread Michael Selik
On Thu, Aug 11, 2016 at 11:46 AM Michael Selik wrote: > On Thu, Aug 11, 2016 at 11:01 AM Steven D'Aprano < > steve+pyt...@pearwood.info> wrote: > >> That ... looks wrong. You're taking something which looks like a procedure >> in the first case (trn.execute), so it

Re: Asynchronous programming

2016-08-11 Thread Michael Selik
On Thu, Aug 11, 2016 at 11:01 AM Steven D'Aprano wrote: > That ... looks wrong. You're taking something which looks like a procedure > in the first case (trn.execute), so it probably returns None, and yielding > over it. Even it that's not wrong, and it actually

Re: Advice on optimizing a Python data driven rules engine

2016-08-11 Thread Michael Selik
On Thu, Aug 11, 2016 at 10:57 AM Malcolm Greene wrote: > Background: I'm building a rules engine for transforming rows of data > being returned by csv DictReader, eg. each row of data is a dict of column > name to value mappings. My rules are a list of rule objects whose >

[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-11 Thread REIX Tony
REIX Tony added the comment: With XLC v13 -O2, using -qalias=noansi for building Objects/longobject.o only and not for all the other .o files did fix the 10 more failed tests I see with -O2 compared to -O0 (7-8 failed tests). So, ANSI-aliasing in Objects/longobject.c is the issue. About

[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-11 Thread Evelyn Mitchell
Evelyn Mitchell added the comment: Thank you Raymond for a detailed patch update. I will mention that matlab does not support this conversion [1]. R doesn't support engineering notation, either. It may be that this conversion isn't expected to be part of the standard library, and people are

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Cecil Westerhof
On Thursday 11 Aug 2016 16:29 CEST, Peter Otten wrote: > Cecil Westerhof wrote: > >> It has been a while since I worked with Python. I wanted to get >> some stats about the idle time of my computer, so that was a good >> moment to pick up Python again. ;-) >> >> >> As I understood it getopt is

[issue12345] Add math.tau

2016-08-11 Thread Guido van Rossum
Guido van Rossum added the comment: It's okay if Python occasionally shows its lighter side in unexpected places. Think of the delight of future (junior) high schoolers who discover that Python participates in the tau debate. :-) Also, I think this video by Vi Hart should be linked to from

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Steven D'Aprano
On Thu, 11 Aug 2016 11:23 pm, Cecil Westerhof wrote: > It has been a while since I worked with Python. I wanted to get some > stats about the idle time of my computer, so that was a good moment to > pick up Python again. ;-) > > > As I understood it getopt is the way to get the parameters for

[issue27738] odd behavior in creating list of lambda expressions

2016-08-11 Thread John Sahr
New submission from John Sahr: The following produces unexpected behavior. I think that it should produce a list of six different lambda expressions, but after creation, all six lambda expressions produce the same output. It's possible that I'm missing something about Python. # begin

[issue17153] tarfile extract fails when Unicode in pathname

2016-08-11 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue27738] odd behavior in creating list of lambda expressions

2016-08-11 Thread Emanuel Barry
Emanuel Barry added the comment: This is due to the fact that Python evaluates the variable 'n' when the function is called, not when it is created. As such, the variable holds the latest value for all functions, and they exhibit identical behaviour. Workaround: ... f = lambda x, n=n:

[issue21018] [patch] added missing documentation about escaping characters for configparser

2016-08-11 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-11 Thread Michael Felt
Michael Felt added the comment: On 02-Aug-16 15:34, Martin Panter wrote: > Martin Panter added the comment: > > For 2.7, adding the automatic RTLD_MEMBER mode does not seem like a bug fix > to me. Currently, I understand this code could load two separate libraries: > > file =

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 05120447f2c6 by Alexander Belopolsky in branch 'default': Issue #24773: Fix and speed-up ZoneInfoCompleteTest. https://hg.python.org/cpython/rev/05120447f2c6 -- ___ Python tracker

Re: Asynchronous programming

2016-08-11 Thread Steven D'Aprano
On Thu, 11 Aug 2016 02:41 pm, Chris Angelico wrote: > Consider these three ways of doing a database transaction: > > def synchronous(id): > trn = conn.begin_transaction() > trn.execute("select name from people where id=%d", (id,)) > name, = trn.fetchone() > trn.execute("update

Advice on optimizing a Python data driven rules engine

2016-08-11 Thread Malcolm Greene
Background: I'm building a rules engine for transforming rows of data being returned by csv DictReader, eg. each row of data is a dict of column name to value mappings. My rules are a list of rule objects whose attributes get referenced by rule specific methods. Each rule has an associated

[issue27643] test_ctypes fails on AIX with xlc

2016-08-11 Thread Michael Felt
Michael Felt added the comment: Had some flooding (leaking pipes, rather values) issues to fix. Will look at this asap. On 04-Aug-16 10:58, Martin Panter wrote: > Martin Panter added the comment: > > Okay, so to be clear, I am assuming XLC supports all of the following fields, > and uses

Re: Asynchronous programming

2016-08-11 Thread Marko Rauhamaa
Steven D'Aprano : > Say I want to download data from a network, and it will take a long > time. If I can do the read in parallel to something else, that makes > sense: > > begin downloading in another thread/process > make a coffee > process download > > But

[issue27734] Memory leaks at Python35-32

2016-08-11 Thread Zachary Ware
Zachary Ware added the comment: Please don't remove yourself from the nosy list, we need your input to figure out exactly what may need to be fixed. -- nosy: +Филипп Пономарев ___ Python tracker

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Can the size of the tests be reduced, [...]? Yes, the long test walks the zoneinfo tree and runs on every tzfile including the aliases. I am going to change that to parsing the zone.tab file for the list of zone names. This should shorten the time

Re: Asynchronous programming

2016-08-11 Thread Steven D'Aprano
On Thu, 11 Aug 2016 03:06 pm, Paul Rubin wrote: > The basic characteristic of asynchronous programming is that it involves > changing all your usual blocking i/o calls to non-blocking ones, so your > program can keep running as soon as your request is started. That's the bit that confuses me. I

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Any news on the remaining failures for year 2037? Yes, the problem was tracked to a bug [1] in zic. If the buildbots get regular updates, the problem will go away with the next tzdata release. Meanwhile, I'll try to figure out a way to suppress the

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Peter Otten
Cecil Westerhof wrote: > It has been a while since I worked with Python. I wanted to get some > stats about the idle time of my computer, so that was a good moment to > pick up Python again. ;-) > > > As I understood it getopt is the way to get the parameters for your > script. But at the

Re: Asynchronous programming

2016-08-11 Thread Marko Rauhamaa
Steven D'Aprano : > Instructions unclear, poked myself in the eye with a sharp stick. I have updated my Dining Philosophers example for Python 3.5: http://pacujo.net/~marko/philosophers.py> It demonstrates how to get an event loop and start a number of asyncs

Re: Asynchronous programming

2016-08-11 Thread Terry Reedy
On 8/11/2016 2:34 AM, Christian Gollwitzer wrote: Am 11.08.16 um 06:38 schrieb Terry Reedy: You might be able to glean something from the succession of files I uploaded to https://bugs.python.org/issue27546 Integrate tkinter and asyncio (and async) I started with just mixing tk and asyncio

[issue27737] email.header.Header.encode() crashes with IndexError on spaces only value

2016-08-11 Thread Tim Graham
New submission from Tim Graham: Python 2.7: >>> from email.header import Header >>> Header(' ').encode() '' Python 3.2+ (I didn't check older versions of Python 3): >>> Header(' ').encode() Traceback (most recent call last): File "", line 1, in File

  1   2   >