[issue38389] Bug on sorted with count key

2019-10-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: 5 and 12 both appear twice in the list, so as far as the key function is concerned, they're equal. -- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python trac

[issue38389] Bug on sorted with count key

2019-10-06 Thread Tamirys Pino
New submission from Tamirys Pino : >>> data=[2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12, 5] >>> data [2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12, 5] >>> sorted(data) [2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 12, 12] >>> sorted(data, key=data.count) [4, 5, 12, 12, 5, 2, 2, 2, 3, 3, 3, 3] [4, 5, 12, 12, 5, 2, 2, 2, 3, 3, 3,

[issue26510] [argparse] Add required argument to add_subparsers

2019-10-06 Thread miss-islington
miss-islington added the comment: New changeset f19b4d7474973236e63d3d8260bfb8072acfff9d by Miss Islington (bot) in branch '3.8': bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588) https://github.com/python/cpython/commit/f19b4d7474973236e63d3d8260bfb8072acfff9d ---

[issue26510] [argparse] Add required argument to add_subparsers

2019-10-06 Thread miss-islington
miss-islington added the comment: New changeset 50b8d579421e621130806e62d6108f5f83d4be7f by Miss Islington (bot) in branch '3.7': bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588) https://github.com/python/cpython/commit/50b8d579421e621130806e62d6108f5f83d4be7f ---

[issue26510] [argparse] Add required argument to add_subparsers

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

[issue26510] [argparse] Add required argument to add_subparsers

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

[issue26510] [argparse] Add required argument to add_subparsers

2019-10-06 Thread miss-islington
miss-islington added the comment: New changeset 9e71917e0290972f65711f75510078f799cf0b59 by Miss Islington (bot) (Adam J. Stewart) in branch 'master': bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588) https://github.com/python/cpython/commit/9e71917e0290972f65711f75

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Warren, the resistance example is excellent, would you like to write up a PR to add it to the docs? In the original design, I prohibited negative numbers because that seems to be what everyone says you should do, but as far as I can tell it is mathem

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I don't have a problem with the current behavior (early out on zero, > even if later arguments are senseless). So: > > > * Just document that there is an early-out for zero. That make the most sense to me as well (even though the OP thinks otherwise). -

[issue38386] ModuleNotFoundError: No module named '_ctypes'

2019-10-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree with Ned closing this issue, but just glancing at the logs, it looks to me like buildozer has shadowed your Python's ctypes with a broken ctypes in /home/yzw/Desktop/Test/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpy

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Tim Peters
Tim Peters added the comment: I don't have a problem with the current behavior (early out on zero, even if later arguments are senseless). So: > * Just document that there is an early-out for zero. -- ___ Python tracker

[issue38386] ModuleNotFoundError: No module named '_ctypes'

2019-10-06 Thread Ned Deily
Ned Deily added the comment: Sorry, you appear to be using a third-party packaging system that provides Python for Android platforms. It's not something we provide or support. You should ask your question of that project (python-for-android perhaps?) or on a forum like StackOverflow. Good

[issue38388] Pickle protocol v 5 needs to be documented

2019-10-06 Thread Dima Tisnek
New submission from Dima Tisnek : Python 3.8 brings new pickle protocol, version 5. It's not documented. ``` (venv) … ~/m/proj> python Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more informat

[issue38387] Document PyDoc_STRVAR

2019-10-06 Thread Brad Solomon
New submission from Brad Solomon : The C-API reference would benefit from a short mention of PyDoc_STRVAR usage, since it is used so frequently within Modules/. -- assignee: docs@python components: Documentation messages: 354053 nosy: bsolomon1124, docs@python priority: normal pull_req

[issue38386] ModuleNotFoundError: No module named '_ctypes'

2019-10-06 Thread yangzongwu
New submission from yangzongwu : I have try the following, but it is no useful sudo apt install libffi-dev but when i import _ctypes under python,it is OK yzw@yzw-virtual-machine:~/Desktop/Test$ python3 Python 3.6.8 (default, Aug 20 2019, 17:12:48) [GCC 8.3.0] on linux Type "help", "copyright

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The resistor example is persuasive :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Warren Weckesser
Warren Weckesser added the comment: I find it hard to accept the first option. It seems to let a detail of the current implementation take precedence over API design. I don't see why we would want an API in which harmonic_mean([1, 0, -1]) returns 0 but harmonic_mean([-1, 0, 1]) raises an e

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Paul and David, is the current PR complete in your opinion? Are there known cases where the PR would break existing, working code? Also there needs to be doc entry that is clear on both new and old strategy for distinguishing options from arguments when

[issue35005] argparse should accept json and yaml argument types

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: I am going to decline this feature request on the principle of keeping our modules loosely coupled and orthogonal to one another. As paul.j3 pointed out, the "type" option seems to work best with simple conversions like "int". As pointed-out by another

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was added. Do you mean any special? -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue21360] mailbox.Maildir should ignore files named with a leading dot

2019-10-06 Thread Abhilash Raj
Abhilash Raj added the comment: David: How do you propose we move forward on this? Should we provide a switch to keep the original behaviour (which is off by default) so if there is someone depending on this bug, they could still continue to do it with relatively small change? It is a chan

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please add a test for this regression. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38385] statistics: incorrect documentation

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is a reasonable suggestion (all iterators are iterable, but not all iterables are iterators). I'll work on it shortly (in conjunction with some other minor doc fixups). -- assignee: docs@python -> rhettinger nosy: +rhettinger, steven.daprano

[issue38385] statistics: incorrect documentation

2019-10-06 Thread Eric O. LEBIGOT
New submission from Eric O. LEBIGOT : The documentation for the statistics package indicates that many of its functions (like median()) accept iterators. They seem to actually accept something more convenient, namely iterables. Thus, iterator could probably be usefully replaced by iterable o

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Normally early-out behaviors are allowed to skip any checks for subsequent inputs (for example, the any() and all() builtins stop consuming inputs one a final value is found). However, that reasoning might not apply to a zero input for harmonic_mean().

[issue38379] finalizer resurrection in gc

2019-10-06 Thread Tim Peters
Tim Peters added the comment: Just noting that check_garbage() currently only determines which trash objects are now directly reachable from outside. To be usable for the intended purpose, it would need to go on to compute which trash objects are reachable from those too. Maybe a new funct

[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-06 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger, steven.daprano versions: +Python 3.7, Python 3.8 ___ Python tracker ___ ___

[issue38384] An assertion failure in test_pickle

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not understand how you got an assertion failure. Did you interrupt tests with Ctrl-C? -- nosy: +serhiy.storchaka ___ Python tracker _

[issue35005] argparse should accept json and yaml argument types

2019-10-06 Thread Mauricio Villegas
Mauricio Villegas added the comment: FYI there is a new python package that extends argparse with the enhancements proposed here and more. https://pypi.org/project/jsonargparse/ -- nosy: +mauvilsa ___ Python tracker

[issue38384] An assertion failure in test_pickle

2019-10-06 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +16194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16606 ___ Python tracker ___ __

[issue38384] An assertion failure in test_pickle

2019-10-06 Thread Zackery Spytz
New submission from Zackery Spytz : When running test_pickle, I sometimes see an assertion failure. ./python -m test test_pickle 0:00:00 load avg: 1.04 Run tests sequentially 0:00:00 load avg: 1.04 [1/1] test_pickle python: Objects/typeobject.c:3151: _PyType_Lookup: Assertion `!PyErr_Occurred(

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread miss-islington
miss-islington added the comment: New changeset ce3c913909746aa1d782ed8bca5076a656422931 by Miss Islington (bot) in branch '3.8': bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603) https://github.com/python/cpython/commit/ce3c913909746aa1d782ed8bca507

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread miss-islington
miss-islington added the comment: New changeset b40442ba88fec5e64ab1802ce37df0afec59fa53 by Miss Islington (bot) in branch '3.7': bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603) https://github.com/python/cpython/commit/b40442ba88fec5e64ab1802ce37df

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

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

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

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

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 24ddd9c2d6ab61cbce7e68d6de36d4df9bd2c3fb by Serhiy Storchaka (Hai Shi) in branch 'master': bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603) https://github.com/python/cpython/commit/24ddd9c2d6ab61cbce

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Dong-hee for your fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c38e725d17537b20ff090b1b5ec7db1820ff9b63 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38210: Fix intersection operation with dict view and iterator. (GH-16602) https://github.com/python/cpython/commit/c38e725d17537b20ff090b1b5ec7d

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16603 ___ Python tracker ___

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread hai shi
New submission from hai shi : `if (start + slen > len)` would cause undefined behavior? such as: start=PY_SSIZE_T_MAX, slen=1 REFS: [1] https://github.com/python/cpython/blob/master/Objects/bytes_methods.c#L746 -- components: Interpreter Core messages: 354032 nosy: shihai1991 priority:

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue38381] Possible wordcode optimization for STORE/LOAD pairs

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I thought about this. But STORE_FAST x is followed by LOAD_FAST x just by accident. If you change the expression (1+x**2 or f(x**2)) they no longer be neighbors. I am not sure this pattern is common enough. There are more common pairs. Also, note that LOA