[issue37128] Add math.perm()

2019-06-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The function which returns the number of ways to choose k items from n items without repetition and without order was added in issue35431. This functions is always goes in pair with other function, which returns the number of ways to choose k items from

[issue37128] Add math.perm()

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: +0 from me. It is inevitable that this will be requested now that we have comb(). The need for this is much less though. -- nosy: +rhettinger ___ Python tracker __

[issue37128] Add math.perm()

2019-06-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +13615 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13731 ___ Python tracker ___

[issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod

2019-06-01 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue37128] Add math.perm()

2019-06-01 Thread Mark Dickinson
Mark Dickinson added the comment: > +0 from me. It is inevitable that this will be requested now that we have > comb(). Exactly my thoughts, too. I don't think I'll have any use for `math.perm`; the main reason to add it will be to satisfy all those who got taught combinations and permutat

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mark, please see: https://twitter.com/daveinstpaul/status/1134919179361034240 What are your thoughts? -- ___ Python tracker ___

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other idea: it may be worth putting in an alias for "binomial" to improve findability and readability in contexts where a person really does what binomial coefficients and is not otherwise thinking about counting contexts. --

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Just a heads up from issue37125: The leak is was fixed by PR13725. -- ___ Python tracker ___ _

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Mark Dickinson
Mark Dickinson added the comment: > What are your thoughts? Sigh. I don't object to extending to `k < 0` and `k > n`, but once we've made that extension it's impossible to undo if we decide we'd rather have had the error checking. I'd really like to see some convincing use-cases. Quotes from

[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f by Terry Jan Reedy (Cheryl Sabella) in branch 'master': bpo-32411: IDLE: Remove line number sort in browser.py (#5011) https://github.com/python/cpython/commit/1a4d9ffa1aecd7e750195f2be06d3d16c7a3a88f -

[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2019-06-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +13616 pull_request: https://github.com/python/cpython/pull/13732 ___ Python tracker ___ __

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2019-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bdbad71b9def0b86433de12cecca022eee91bd9f by Serhiy Storchaka in branch 'master': bpo-20092. Use __index__ in constructors of int, float and complex. (GH-13108) https://github.com/python/cpython/commit/bdbad71b9def0b86433de12cecca022eee91bd9f

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I'd say leave it as-is for 3.8, see what the reaction is, > and maybe relax constraints in 3.9 if that seems appropriate. I concur. That said, the referenced tweet was a reaction :-) FWIW, itertools.combinations(seq, r) returns 0 values when r > len(se

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Mark Dickinson
Mark Dickinson added the comment: I'm particularly sceptical about real-world use-cases for k < 0. Maybe we should consider removing just the k > n requirement. -- ___ Python tracker ___

[issue29414] Change 'the for statement is such an iterator' in Tutorial

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 218e47b61862470477922e9aba1a23fd3dab18ae by Raymond Hettinger (Marco Buttu) in branch 'master': bpo-29414: Change 'the for statement is such an iterator' in Tutorial (GH-273) https://github.com/python/cpython/commit/218e47b61862470477922e9aba

[issue29414] Change 'the for statement is such an iterator' in Tutorial

2019-06-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34722] Non-deterministic bytecode generation

2019-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Bumping up the priority a bit on this one. It would be nice to get it in for 3.8. -- priority: normal -> high versions: +Python 3.8 -Python 3.7 ___ Python tracker _

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Tim Peters
Tim Peters added the comment: Strongly prefer requiring 0 <= k <= n at first. This is a programming language: it will be applied to real problems, not to abstract proofs where some slop can be helpful in reducing the number of cases that need to be considered. The Twitter fellow is certai

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +13617 pull_request: https://github.com/python/cpython/pull/13734 ___ Python tracker ___ ___

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-06-01 Thread Eric Snow
Eric Snow added the comment: New changeset 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc by Eric Snow in branch 'master': bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-13714) https://github.com/python/cpython/commit/6a150bcaeb190d1731b38ab9c7a5d1a352847ddc -

[issue37129] Add RWF_APPEND flag

2019-06-01 Thread Michal
Change by Michal : -- keywords: +patch pull_requests: +13618 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13735 ___ Python tracker ___ _

[issue37129] Add RWF_APPEND flag

2019-06-01 Thread Michal
Change by Michal : -- components: Library (Lib) nosy: bezoka, pablogsal, vstinner priority: normal severity: normal status: open title: Add RWF_APPEND flag type: enhancement versions: Python 3.8 ___ Python tracker

[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2019-06-01 Thread miss-islington
miss-islington added the comment: New changeset ac60d1afd2b04f61fe4c965740fa32809f2b84ed by Miss Islington (bot) in branch '3.7': bpo-32411: IDLE: Remove line number sort in browser.py (GH-5011) https://github.com/python/cpython/commit/ac60d1afd2b04f61fe4c965740fa32809f2b84ed -- nos

[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: yes ;-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue35431] Add a function for computing binomial coefficients to the math module

2019-06-01 Thread David Radcliffe
David Radcliffe added the comment: I think that binomial(n, k) should return 0 when k > n or k < 0. This is a practical consideration. I'm concerned about evaluating sums involving binomial coefficients. Mathematicians are often rather loose about specifying the upper and lower bounds of sum

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-06-01 Thread Eric Snow
Eric Snow added the comment: So far so good. :) I'll keep an eye on things and if the buildbots are still happy then I'll add back _PyEval_FinishPendingCalls() in _Py_FinalizeEx() in a few days. -- ___ Python tracker

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-06-01 Thread Eric Snow
Eric Snow added the comment: FYI, after merging that PR I realized that the COMPUTE_EVAL_BREAKER macro isn't quite right. While the following scenario worked before, now it doesn't: 1. interpreter A: _PyEval_AddPendingCall() causes the global eval breaker to be set 2. interpreter B: the n

[issue36985] typing.ForwardRef is undocumented

2019-06-01 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Guido, I remember you were against exposing `ForwardRef` as public at some point, but recently you approved https://github.com/python/cpython/pull/13456 that added it to `typing.__all__`. I don't have any particular opinion on this, but if you don't object,

[issue5680] Simulate command-line arguments for program run in IDLE

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: 3 recent 'doit' requests (2 on PR 1589) raise my priority for this issue. When a user runs a file from an editor, IDLE simulates, as well as it can, the user entering 'python -i path' in a system command line shell. Both on a command line and in IDLE, the

[issue36984] typing docs "versionadded" is inaccurate for many attributes

2019-06-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +13620 pull_request: https://github.com/python/cpython/pull/13737 ___ Python tracker ___ __

[issue36984] typing docs "versionadded" is inaccurate for many attributes

2019-06-01 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue5680] Simulate command-line arguments for program run in IDLE

2019-06-01 Thread Cheryl Sabella
Cheryl Sabella added the comment: I'll can work on a PR for this, unless you want to do it based on your research. -- nosy: +cheryl.sabella ___ Python tracker ___ _

[issue5680] Simulate command-line arguments for program run in IDLE

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: When running IDLE normally, with a subprocess, it would be possible to pass arguments to python itself when IDLE restarts the user process (with shell.restart_shell()). That would be another issue. We would have to look at whether any options would disable

[issue37130] pathlib.with_name() doesn't like unnamed files.

2019-06-01 Thread N.P. Khelili
New submission from N.P. Khelili : Hi guys! I'm new to python and working on my first real project with it I'm sorry if it's not the right place for posting this. I noticed that that pathlib.with_name() method does not accept to give a name to a path that does not already have one. It se

[issue5680] Simulate command-line arguments for program run in IDLE

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: My suspicion about posix=False was wrong. >>> shlex.split(''' 1 "'a' 'b'" ''', posix=False) ['1', '"\'a\' \'b\'"'] # len(...[1]) = 9 >>> shlex.split(''' 1 '"a" "b"' ''') ['1', '"a" "b"'] # len = 7 f:\dev\3x>py -c "import sys; print(sys.argv)" 1 "'a' 'b'" ['-

[issue5680] Simulate command-line arguments for program run in IDLE

2019-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Cheryl, go ahead after reading the notes above. Use an f-string for the runcommand argument and remember that it is run within the pristine user environment. Otherwise, let's start with minimal changes. -- ___ P

[issue36839] Support the buffer protocol in code objects

2019-06-01 Thread Inada Naoki
Inada Naoki added the comment: > And I understood that Dino proposed to share one code instance as a memory > mapped file for *all* processes. What instance means? code object? co_code? Anyway, Dino didn't propose such thing. He only proposed accepting buffer object for code constructor. H

[issue35964] shutil.make_archive (xxx, tar, root_dir) is adding './' entry to archive which is wrong

2019-06-01 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13621 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13738 ___ Python tracker __

[issue35964] shutil.make_archive (xxx, tar, root_dir) is adding './' entry to archive which is wrong

2019-06-01 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: I submitted a pull request that excludes '.' directory entries when adding directories to a tar archive. -- ___ Python tracker ___ __

[issue32865] os.pipe creates inheritable FDs with a bad internal state on Windows

2019-06-01 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +13622 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/13739 ___ Python tracker ___

[issue36781] Optimize sum() for bools

2019-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure that this optimization should be added. sum(pred(x) for x in data) will be always slower than sum(1 for x in data if pred(x)) because more items is passed to sun() in the former case. It can be considered as an anti-pattern. --

[issue36839] Support the buffer protocol in code objects

2019-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The managed buffer can be shared if it refers to the same bytes. But different code objects in the same process refer to different bytes, therefore they should have distinct managed buffers. -- ___ Python tracke

<    1   2