[issue27749] python 3.5.2 maybe crash

2016-08-12 Thread Eryk Sun
Eryk Sun added the comment: To diagnose the access violation, it may help if you install the debug binaries and try to reproduce the crash using python_d.exe. Attach the dump file to this issue. Regarding the multiprocessing question, if its a separate issue you need to file it on its own

[issue27749] python 3.5.2 maybe crash

2016-08-12 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue27698] socketpair not in socket.__all__ on Windows

2016-08-12 Thread Eryk Sun
Changes by Eryk Sun : -- keywords: +easy ___ Python tracker ___ ___

[issue24637] locals dictionary in PyRun_String

2016-08-12 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Matthew! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24637] locals dictionary in PyRun_String

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0f2a09950ac8 by Berker Peksag in branch '3.5': Issue #24637: Document that locals can be any mapping object https://hg.python.org/cpython/rev/0f2a09950ac8 New changeset 61c4dbec2e2c by Berker Peksag in branch 'default': Issue #24637: Merge from 3.5

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread Tim Peters
Changes by Tim Peters : -- resolution: -> rejected stage: -> resolved ___ Python tracker ___

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread YoSTEALTH
YoSTEALTH added the comment: Tim, I get what you are saying good point. -- status: open -> closed ___ Python tracker ___

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread Tim Peters
Tim Peters added the comment: Note that "iterable" covers a world of things that may not support indexing (let alone slicing). For example, it may be a generator, or a file open for reading. -- nosy: +tim.peters ___ Python tracker

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread YoSTEALTH
New submission from YoSTEALTH: # Link: https://docs.python.org/3/library/itertools.html#itertools-recipes # Function pairwise() in Itertools -> Recipes could be improved!? Here is the code: import time import itertools def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..."

[issue27038] Make os.DirEntry exist

2016-08-12 Thread Brendan Moloney
Brendan Moloney added the comment: It makes it much easier to write functions that can work with either a DirEntry object or a plain path. -- ___ Python tracker

[issue27038] Make os.DirEntry exist

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: Exposing a class method to construct one is no different than exposing the constructor, so it's still not desired to have. What is the specific need you have for creating a DirEntry instance on its own? -- ___ Python

[issue27038] Make os.DirEntry exist

2016-08-12 Thread Brendan Moloney
Brendan Moloney added the comment: It would be nice if there was a supported way to create a DirEntry object from a path. If you don't want to document the constructor perhaps expose some helper function or class method (i.e. from_path)? -- nosy: +moloney

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 71a7db7ceabc by Alexander Belopolsky in branch 'default': Issue #24773: Skip system tests for transitions in year 2037 and later. https://hg.python.org/cpython/rev/71a7db7ceabc -- ___ Python tracker

[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-12 Thread Ned Deily
Ned Deily added the comment: >So what happens if you comment out line 34? > macosx.setupApp(cls.root, None) That seems to eliminate the intermittent "IndexError: list assignment index out of range" and doesn't seem to cause any new errors. -- ___

[issue12345] Add math.tau

2016-08-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > All that said, I agree with Mark that math.e is at best an attractive > nuisance. Why don't we fix the nuisance part without making it less attractive: class _E(float): def __pow__(self, other): if self is e: return exp(other)

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-08-12 Thread Keith Brafford
Keith Brafford added the comment: Serge, I wrote this awhile back, before I learned you aren't supposed to subclass built-in types. Is this the type of effect you're looking for? https://gist.github.com/kbrafford/da39e06d18b6df2a0eecb4493699 Here's an example using it:

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: The revision that Ned found only changed posixmodule.c by adding PyModule_AddObject(m, "DirEntry", (PyObject *)); at the end of the module initializer. Only thing I can think of is it needs to go into the `if (!initialized)` block:

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-08-12 Thread Stefan Krah
Stefan Krah added the comment: On Fri, Aug 12, 2016 at 08:38:52PM +, Serge Stroobandt wrote: > This should not be that difficult to implement? > I promise, every six months an engineer will stop by here asking for this. > Instead of nagging, this could already have been implemented one way

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-08-12 Thread Serge Stroobandt
Serge Stroobandt added the comment: What most engineers would like to see implemented in Python is a new engineering notation identical to the one implemented in the omnipresent HP calculators. Quoting from the HP-15C Owner's Handbook: "- In engineering notation, the first significant digit

[issue12345] Add math.tau

2016-08-12 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: What about rounding pi to 3 (and tau to 6)? https://en.wikipedia.org/wiki/Indiana_Pi_Bill (and I'm sure we can find a cute video about how cool to have pi as 3 to add it to the docs). -- nosy: +pfalcon ___ Python

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Ned Deily
Ned Deily added the comment: Thanks for the good test, Simon. Bisection points to b841972ed0bd for Issue27038 as the culprit here. (It was pushed between 3.6.0a2 and a3.) Brett, Jelle, can you please take a look at this? I'm going to keep it as a Release Blocker for now. --

[issue27182] PEP 519 support in the stdlib

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: Here is an odd patch because I don't know where else to put it ATM that adds the remaining support in the os module/package not covered by other issues w/ patches (specifically os.walk() and os.fwalk()). I think everything else simply falls through thanks to

[issue27750] Idle editor crashes when input size more than 250 lines given

2016-08-12 Thread chinmay hegde
New submission from chinmay hegde: Idle editor crashes when input size more than 250 lines given. Steps to reproduce:- try with below snippet of code for i in range(250): n=input() Execute the snippet of code. But while giving the input copy all 250 inputs with single paste. Editor is

[issue26027] Support Path objects in the posix module

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: Here is an updated patch that adds in change to posixmodule.c stemming from the new warning about using bytearrays. It also makes type checking more stringent for what __fspath__() returns. -- Added file:

[issue12345] Add math.tau

2016-08-12 Thread Tim Peters
Tim Peters added the comment: Serhiy's objection is a little subtler than that. The Python expression `math.log(math.e)` in fact yields exactly 1.0, so IF it were the case that x**y were implemented as math.exp(math.log(x) * y) THEN math.e**500 would be computed as math.exp(math.log(math.e)

[issue27747] Broken example in the queue module documentation

2016-08-12 Thread R. David Murray
Changes by R. David Murray : -- stage: -> resolved type: enhancement -> behavior ___ Python tracker ___

[issue27712] Tiny typos in import.rst

2016-08-12 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work too! :) -- ___ Python tracker ___ ___ Python-bugs-list

[issue25805] Failure in test_pkgutil run from command-line

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 863258dcb745 by Brett Cannon in branch 'default': Issue #25805: Skip a test for test_pkgutil when __name__ == __main__. https://hg.python.org/cpython/rev/863258dcb745 -- nosy: +python-dev ___ Python

[issue25805] Failure in test_pkgutil run from command-line

2016-08-12 Thread Brett Cannon
Changes by Brett Cannon : -- stage: patch review -> resolved ___ Python tracker ___ ___

[issue27712] Tiny typos in import.rst

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 927c29e1d646 by Brett Cannon in branch '3.5': Issue #27712: Fix some typos in the import docs. https://hg.python.org/cpython/rev/927c29e1d646 New changeset 42a461366d6c by Brett Cannon in branch 'default': Merge for issue #27712

[issue27712] Tiny typos in import.rst

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch! -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue25805] Failure in test_pkgutil run from command-line

2016-08-12 Thread Brett Cannon
Brett Cannon added the comment: Since most people just run tests using `-m test` I only applied the fix to 3.6. Thanks for the patch, SilentGhost! -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue25805] Failure in test_pkgutil run from command-line

2016-08-12 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon nosy: +brett.cannon ___ Python tracker ___

[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-12 Thread Quentin Pradet
Quentin Pradet added the comment: Thanks levkivskyi, it fixed the issue for me! -- ___ Python tracker ___ ___

[issue25805] Failure in test_pkgutil run from command-line

2016-08-12 Thread SilentGhost
SilentGhost added the comment: Could anyone could have a look at this fairly trivial patch? -- ___ Python tracker ___

[issue27747] Broken example in the queue module documentation

2016-08-12 Thread Paulo Gabriel Poiati
Paulo Gabriel Poiati added the comment: You are absolutely right David. I was calling join after putting `None` in the queue. Sorry, I'm closing this. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue27748] Simplify test_winsound

2016-08-12 Thread Zachary Ware
New submission from Zachary Ware: test_winsound is rather annoying. It currently attempts to determine whether a sound card is present, and whether particular system sounds are available. These checks are fragile at best, and I routinely see failures that shouldn't be. In particular, if I

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread SilentGhost
Changes by SilentGhost : -- stage: -> resolved ___ Python tracker ___ ___

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

2016-08-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

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

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6fdd29a9d5d4 by Raymond Hettinger in branch '3.5': Issue 27719: Remove a doc example that is not applicable in Python 3 https://hg.python.org/cpython/rev/6fdd29a9d5d4 -- nosy: +python-dev ___ Python

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Wolfgang, sorry you bumped into this problem and glad that you have a workaround. We only guarantee availability of backward compatible seeders and that calls to random() are reproducible. The other methods are allowed to change so that we can make

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-08-12 Thread Fabio Alessandro Locati
Fabio Alessandro Locati added the comment: Any news on this? -- nosy: +Fabio Alessandro Locati ___ Python tracker ___

[issue27747] Broken example in the queue module documentation

2016-08-12 Thread R. David Murray
R. David Murray added the comment: The example looks correct to me. Have you tested it and seen it hang? The q.join() is done, and returns once all the puts have been processed. *Then* None is put for each worker, which terminates the worker thread. There's no q.join() to block at that

[issue27738] odd behavior in creating list of lambda expressions

2016-08-12 Thread John Sahr
John Sahr added the comment: I eventually figured that out that source of the problem; thanks for the coding fix; that's useful to know. -John On Thu, Aug 11, 2016 at 8:17 AM, Emanuel Barry wrote: > > Emanuel Barry added the comment: > > This is due to the fact that

[issue27747] Broken example in the queue module documentation

2016-08-12 Thread Paulo Gabriel Poiati
New submission from Paulo Gabriel Poiati: I believe the code example at https://docs.python.org/3.6/library/queue.html is broken. The break condition in the worker loop (when the queued value is None) must call the `task_done` before breaking, otherwise the code blocks indefinitely in the

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-12 Thread Christian Heimes
Changes by Christian Heimes : Removed file: http://bugs.python.org/file44088/Microsoft_Screen_Sharing_for_Lumia_Phones_HD-10_UG_th_TH.pdf ___ Python tracker

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-12 Thread Pan Naekton
Changes by Pan Naekton : Added file: http://bugs.python.org/file44088/Microsoft_Screen_Sharing_for_Lumia_Phones_HD-10_UG_th_TH.pdf ___ Python tracker

[issue25825] AIX shared library extension modules installation broken

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 58c8cae6c61a by Martin Panter in branch '3.5': Issue #25825: Fix references to Modules/python.exp https://hg.python.org/cpython/rev/58c8cae6c61a New changeset 4d4b5b978b7e by Martin Panter in branch 'default': Issue #25825: Merge AIX fix from 3.5

[issue25825] AIX shared library extension modules installation broken

2016-08-12 Thread David Edelsohn
David Edelsohn added the comment: Yes, please apply Patch 1 that reverts the mistaken change of revision 88a532a31eb3 . I want to work through this incrementally so that it's clear to reviewers. -- ___ Python tracker

[issue12887] Documenting all SO_* constants in socket module

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

[issue24363] httplib fails to handle semivalid HTTP headers

2016-08-12 Thread Martin Panter
Martin Panter added the comment: In order to avoid messing too much with the intricacies of the existing email parsing, here is a patch for Python 3 that limits the behaviour changes to the HTTP module. It should fix the bad handling of broken header lines. As a side effect, it should also

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread SilentGhost
SilentGhost added the comment: Thanks, Lele. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread Martin Panter
Martin Panter added the comment: No super important reason, just to avoid indenting the code. This is a medium-sized test function, with a few long lines already. And if you keep the indentation the same, it makes it easier to port other changes to Python 2, look through the repository

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread STINNER Victor
STINNER Victor added the comment: Martin: why don't you use "with"? -- ___ Python tracker ___ ___

[issue12345] Add math.tau

2016-08-12 Thread STINNER Victor
STINNER Victor added the comment: > math.e**500 = math.exp(math.log(math.e)*500) That's the theory if numbers have an infinite precision. In practice, intermediate results are rounded and have a limited precision. -- ___ Python tracker

[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f78a682a3515 by Martin Panter in branch '3.5': Issue #26741: Clean up subprocess.Popen object in test_poll https://hg.python.org/cpython/rev/f78a682a3515 New changeset 7ff3ce0dfd45 by Martin Panter in branch 'default': Issue #26741: Merge

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 129c601e7bfa by Martin Panter in branch '3.5': Issue #27745: Fix some typos in Argument Clinic howto, by Lele Gaifax https://hg.python.org/cpython/rev/129c601e7bfa New changeset 8c33152fd75c by Martin Panter in branch 'default': Issue #27745: Merge

[issue27730] Update shutil to work with max file path length on Windows

2016-08-12 Thread Eryk Sun
Eryk Sun added the comment: I overlooked some aspects of the problem: * A short relative path may end up exceeding MAX_PATH when normalized as a fully qualified path. * The working directory may be a UNC path or may already have the \\?\ prefix. It's not thread-safe to check this beforehand.

[issue27746] ResourceWarnings in test_asyncio

2016-08-12 Thread Martin Panter
New submission from Martin Panter: $ ./python -bWerror -m test -r -u all . . . 0:12:58 [ 70/402] test_asyncio Exception ignored in: > Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/asyncio/sslproto.py", line 329, in __del__ source=self) ResourceWarning:

[issue27539] negative Fraction ** negative int not normalized

2016-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: > _Please_, can this go in before 15th? Note that this is a bugfix, not a new feature, so it can still go in after the 15th. -- ___ Python tracker

[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-12 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: You could try changing this line in compile.c (in function 'assemble') if (entryblock && entryblock->b_instr) to if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno) Does this help? -- nosy: +levkivskyi

[issue27181] Add geometric mean to `statistics` module

2016-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: > According to my testing, math.pow(x, 0.5) is no worse than sqrt. It certainly is worse than sqrt, both in terms of speed and accuracy. Whether the difference is enough to make it worth special-casing is another question, of course, and as you say, that can

[issue27350] Compact and ordered dict

2016-08-12 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44086/compact-dict.patch ___ Python tracker ___

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-12 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file44085/Py_CompileStringExFlags_doc.patch ___ Python tracker ___

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-12 Thread Xiang Zhang
Changes by Xiang Zhang : Removed file: http://bugs.python.org/file44078/Py_CompileStringExFlags_doc.patch ___ Python tracker ___

[issue27181] Add geometric mean to `statistics` module

2016-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I thought about special-casing n=2 to math.sqrt, but as that's an implementation detail I can make that change at any time. According to my testing, math.pow(x, 0.5) is no worse than sqrt, so I'm not sure if there's any advantage to having yet another

[issue27743] Python 2 has a wrong artificial limit on the amount of memory that can be allocated in ctypes

2016-08-12 Thread Eryk Sun
Eryk Sun added the comment: AFAIK this only affects Windows. It looks like a relatively simple fix. In PyCArrayType_new, change the declaration of `length` to Py_ssize_t to match the definition StgDictObject.length; ensure the _length_ attribute is an index via PyIndex_Check instead of

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread SilentGhost
SilentGhost added the comment: LGTM -- stage: -> commit review type: -> behavior ___ Python tracker ___ ___

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread SilentGhost
Changes by SilentGhost : -- components: +Documentation versions: +Python 3.5 ___ Python tracker ___

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread Lele Gaifax
Changes by Lele Gaifax : Removed file: http://bugs.python.org/file44083/ac-doc-typos.patch ___ Python tracker ___

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread Lele Gaifax
Lele Gaifax added the comment: Re-uploaded the patch file, without spurious stuff. -- Added file: http://bugs.python.org/file44084/ac-doc-typos.patch ___ Python tracker

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread Lele Gaifax
Lele Gaifax added the comment: Yes, sorry about that, picked the wrong file :-| I will renew the patch shortly! -- components: -Documentation versions: -Python 3.5 ___ Python tracker

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread SilentGhost
SilentGhost added the comment: Then I guess all the changes to Modules/_sqlite.c are there by mistake? Would you mid refreshing your patch to remove them? -- assignee: -> docs@python components: +Documentation nosy: +SilentGhost, docs@python versions: +Python 3.5

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: Anyhow, in this case it is easy to simulate the Python 2 randint behaviour (add checks for hi >= lo if needed): >>> random.seed(5, version=1) >>> randint_compat = lambda lo, hi: lo + int(random.random() * (hi + 1 - lo)) >>> randint_compat(0,

[issue27745] Fix typos in Argument Clinic howto

2016-08-12 Thread Lele Gaifax
New submission from Lele Gaifax: The attached patch, available also as https://github.com/lelit/cpython/commit/9e33f33e87ad594daae71ccdbe6f0a5c5f8aca65, fixes a few typos in the Argument Clinic howto document. -- components: Argument Clinic files: ac-doc-typos.patch keywords: patch

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-12 Thread Cory Benfield
Changes by Cory Benfield : -- nosy: +Lukasa ___ Python tracker ___ ___ Python-bugs-list

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread Wolfgang Rohdewald
Wolfgang Rohdewald added the comment: @SilentGhost: Sorry, I did not see the latest messages, I was referring to msg272511 Having to re-implement everything but rnd.random is not very user friendly. I will do that now for my project. -- ___ Python

[issue27744] Add AF_ALG (Linux Kernel crypto) to socket module

2016-08-12 Thread Christian Heimes
New submission from Christian Heimes: Linux has a netlink-based user-space interface for Kernel cryptography. Kernel based crypto has a couple of advantages that are explained at http://www.chronox.de/libkcapi/html/ch01s02.html . The document doesn't mention that a crypto socket also supports

[issue27742] Random.randint generates different values in Python2 and Python3

2016-08-12 Thread SilentGhost
SilentGhost added the comment: > There seems to be more to it I'm not sure what "it" are you referring to. The output of randint is not guaranteed to be the same across versions, the seeded sequence is still the same between python2 and 3 - as documented. -- title: Random.seed(5,

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread Wolfgang Rohdewald
Wolfgang Rohdewald added the comment: There seems to be more to it, _randbelow already returns different values. And _randbelow is used by other user helpers like randrange, choice, select, shuffle, sample -- ___ Python tracker

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: but yes, now that I read the documentation, 3.5 docs it say very explicitly that: Two aspects are guaranteed not to change: - If a new seeding method is added, then a backward compatible seeder will be offered. - The generator’s random() method will

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: Sorry + and - are backwards there (I did the delta in wrong direction); + is before, and - after Raymond's commit. The `if` was retained there for backward-compatibility. -- ___ Python tracker

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: It is this change in 3.2: randrange is more sophisticated about producing equally distributed values. Formerly it used a style like ``int(random()*n)`` which ' could produce slightly uneven distributions. -return

[issue27743] Python 2 has a wrong artificial limit on the amount of memory that can be allocated in ctypes

2016-08-12 Thread tzickel
New submission from tzickel: Python 2 has a wrong artificial limit on the amount of memory that can be allocated in ctypes via sequence repeating (i.e. using create_string_buffer or c_char * ) The problem is practical in Windows 64 bit, when running python 64 bit, since in that platform the

[issue12345] Add math.tau

2016-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > To give just one example, on my machine, the result of `exp(500)` has an > error of 0.42 ulps, while `math.e**500` gives an error of over 150 ulps. How can it be? math.e**500 = math.exp(math.log(math.e)*500) and math.log(math.e) is 1.0. --

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread SilentGhost
SilentGhost added the comment: The rnd.random is still producing the same sequence, between versions. randint evidently doesn't, but that must be happening elsewhere. -- components: +Extension Modules nosy: +SilentGhost, mark.dickinson, rhettinger type: -> behavior versions: +Python

[issue12345] Add math.tau

2016-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: BTW, if we're talking about useless constants in the math module, it's hard to get more useless than `math.e`: it's rare for `e` to turn up in formulas except in the form `e**`, and the latter case is better catered for by the more accurate (and usually

[issue27742] Random.seed(5, version=1) generates different values in PYthon2 and Python3

2016-08-12 Thread Wolfgang Rohdewald
New submission from Wolfgang Rohdewald: The documentation promises backwards compatible seeders. I understand this as such that they generate the same random sequences. But for Python 2.7.12 and 3.5.2 this is not so, even if I pass an integer as seed value. The attached script returns

[issue12345] Add math.tau

2016-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: The unification of tau2.diff and tau3.diff LGTM; thanks, Lisa! My commit bit is broken at the moment; anyone in a position to apply those patches? -- ___ Python tracker

[issue27181] Add geometric mean to `statistics` module

2016-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: What no patch for pre-commit review?! For computing nth roots, it may be worth special-casing the case n=2: for floats, `math.sqrt` is likely to be faster and more precise than an ad-hoc algorithm. (Indeed, I'd expect it to be perfectly correctly rounded on

[issue27128] Add _PyObject_FastCall()

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: About "I hesitate between the C types "int" and "Py_ssize_t" for nargs. I read once that using "int" can cause performance issues on a loop using "i++" and "data[i]" because the compiler has to handle integer overflow of the int type." This is true because of

[issue23545] Turn on extra warnings on GCC

2016-08-12 Thread Antti Haapala
Antti Haapala added the comment: Ah, indeed, I somehow missed that. Though, there is no good reason for it being unsigned either; as the actual type in SSL API's is of type int. Another argument of type int is cast to unsigned just for the comparison on line 4419, and unsigned int counters i

[issue23545] Turn on extra warnings on GCC

2016-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems GCC is such smart, that can deduce that the maximal value of _ssl_locks_count is never larger than PY_SSIZE_T_MAX / sizeof(PyThread_type_lock). The other workaround is making _ssl_locks_count of type size_t instead of unsigned int, but I wouldn't do

[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-12 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +ned.deily priority: normal -> release blocker ___ Python tracker ___

[issue27574] Faster parsing keyword arguments

2016-08-12 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___