[issue46200] Discourage logging f-strings due to security considerations

2021-12-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8d7644fa64213207b8dc6f555cb8a02bfabeced2 by andrei kulakov in branch 'main': bpo-45853: Fix misspelling and unused import in pathlib (GH-30292) https://github.com/python/cpython/commit/8d7644fa64213207b8dc6f555cb8a02bfabeced2 -- ___

[issue46200] Discourage logging f-strings due to security considerations

2021-12-29 Thread Arie Bovenberg
New submission from Arie Bovenberg : (I've already submitted this issue to secur...@python.org, who directed me to propose a documentation change here) Logging f-strings is quite popular, because the `%` style of logging is often considered ugly. However, logging preformatted strings comes wi

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Okay. As a workaround we can explicitly specify the dispatching type: @f.register(list) def _(a: list[int]) -> None: pass -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python trac

[issue46199] Calculation influenced by print

2021-12-29 Thread Eric V. Smith
Eric V. Smith added the comment: This is likely not a bug in python. You might have better luck asking on a numpy support list. That said, what results do you get, and what do you expect to get? We don't know what error you're seeing. You might replace: print("LB: ", LB) with: str(LB) and

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Dong-hee Na added the comment: Thanks for reporting Kevin! -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
miss-islington added the comment: New changeset 2d4049da1f61df5cb4314d7e10b54fa556880b0e by Miss Islington (bot) in branch '3.9': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/2d4049da1f61df5cb4314d7e10b54fa556880b0e --

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
miss-islington added the comment: New changeset 1b37268ef10bd20c30d349b8401c88215c8a6be8 by Miss Islington (bot) in branch '3.10': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/1b37268ef10bd20c30d349b8401c88215c8a6be8 --

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Tim Peters
Tim Peters added the comment: [Tim] > That's [Mark's code] cheaper than almost every case handled by > perm_comb_small()'s current ... "iscomb" loop. Although I should clarify they're aimed at different things, and don't overlap all that much. Mark's code, & even more so Raymond's extension,

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset fb44d0589615590b1e7895ba78a038e96b15a219 by Dong-hee Na in branch 'main': bpo-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290) https://github.com/python/cpython/commit/fb44d0589615590b1e7895ba78a038e96b15a219 -- ___

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +28512 pull_request: https://github.com/python/cpython/pull/30300 ___ Python tracker ___ __

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28511 pull_request: https://github.com/python/cpython/pull/30299 ___ Python tracker _

[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-29 Thread Ilya Grigoriev
Ilya Grigoriev added the comment: Thank you very much, Nikita! Your patch would certainly solve my issue. As is, I checked the code I wrote, and it seems that only a lucky ordering of if-statements caused it to work on Macs. Ilya. On Wed, Dec 29, 2021 at 5:30 PM Dong-hee Na wrote: > > > Don

[issue46199] Calculation influenced by print

2021-12-29 Thread wby78826
New submission from wby78826 : (Could be a numpy bug) ##Just run the script, then uncomment Line 14 and run again The result of "supertrend" is different, depending on whether I print "LB" first or not. If I don't print it first, the result is wrong. It also does'nt matter if I print it to std

[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-29 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset d12bec69931503be78cd555cf7bc22ad6f4f2bd5 by Nikita Sobolev in branch 'main': bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241) https://github.com/python/cpython/commit/d12bec69931503be78cd555cf7bc22ad6f4f2bd5 --

[issue41569] json.JSONEncoder.default should be called for dict keys as well

2021-12-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> json.dump() ignores its 'default' option when serializing dictionary keys ___ Python tracker

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: And on 3.9 as well. -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- versions: +Python 3.10, Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: I can verify that this happens on `3.10` and `main` branches: ``` from typing import Annotated, Optional, get_type_hints class Foo: def __init__(self, x: Annotated[Optional[str], "d"] = None): ... class Foo2: x: Annotated[Optional[str], "d"] = None

[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28510 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30297 ___ Python tracker ___ _

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Alex Waygood
Alex Waygood added the comment: Yeah, I think I agree with Guido. Mypy only has partial support for singledispatch anyway, and only achieves that through a plugin, so special-casing by type-checkers is inevitable. -- ___ Python tracker

[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev
New submission from Nikita Sobolev : There are two tests with the same name in a same test class in `Lib/test/test_email/test__header_value_parser.py`: `test_get_unstructured_invalid_ew` 1. https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email/te

[issue13672] Add co_qualname attribute in code objects

2021-12-29 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Propagate qualname from the compiler unit to code objects for finer grained profiling data ___ Python tracker

[issue12535] Chained tracebacks are confusing because the first traceback is minimal

2021-12-29 Thread Irit Katriel
Irit Katriel added the comment: This was created about 10 years ago, I wonder if people still feel there is a need to change something here, or did we all get used to the status quo by now? In particular, the suggestion is to indicate that the traceback of chained exceptions is truncated. -

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Guido van Rossum
Guido van Rossum added the comment: If we allow registering list[int] but give it the same meaning as registering plain list (at runtime), that would violate user expectations pretty strongly -- for the same reason why we don't allow isinstance(x, list[int]). If you want stronger checking in

[issue45108] frame.f_lasti points at DICT_MERGE instead of CALL_FUNCTION_EX in Windows only

2021-12-29 Thread Irit Katriel
Irit Katriel added the comment: I've reproduced this on 3.10 but in 3.11 the result on windows is correct, f_lasti is of the CALL_FUNCTION_EX opcode. -- nosy: +iritkatriel ___ Python tracker ___

[issue46197] ensurepip bootstrap breaks out of isolated environment

2021-12-29 Thread kcdodd
New submission from kcdodd : A change in behavior was made to the `ensurepip` module in Python 3.8.7 that causes bootstrapping to break out of an isolated environment. This is relevant to the assumption made in the `venv` module, which ran ensurepip as a sub-process with the `-I` flag environ

[issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not present in code

2021-12-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 9f0e40fae5191c3e3ed6109bd2e2f97aa0ac8d64 by Miss Islington (bot) in branch '3.10': closes bpo-38522 docs: remove references to Py_USING_MEMORY_DEBUGGER (GH-30284) (GH-30295) https://github.com/python/cpython/commit/9f0e40fae5191c3e3ed6109bd2

[issue9350] add remove_argument_group to argparse

2021-12-29 Thread Irit Katriel
Change by Irit Katriel : -- stage: needs patch -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mail

[issue46196] documentation for cmd library should include columnize() function

2021-12-29 Thread sharewell
New submission from sharewell : Cmd.columnize is an extremely useful function in Python, that can be used in many situations. It is part of the Cmd library. Unfortunately, the Cmd documentation does not mention it. It should. I only found out about it via https://stackoverflow.com/a/59627245

[issue17024] cElementTree calls end() on parser taget even if start() fails

2021-12-29 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> works for me stage: needs patch -> resolved status: pending -> closed ___ Python tracker ___ ___

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Tim Peters
Tim Peters added the comment: A practical caution about this in comb_with_side_limits.py: Pmax = 25 # 25 41 Fmax = Pmax It's true then that 25! == F[25] << S[25], but that's so in Python. The result has 84 bits, so 64-bit C arithmetic isn't enough. That's apparentl

[issue28141] shutil.copystat utime lookup fails on certain Android file systems

2021-12-29 Thread Irit Katriel
Irit Katriel added the comment: Please create a new issue if this is still a problem on a currentl version of python (>= 3.9). -- resolution: -> out of date stage: -> resolved status: pending -> closed ___ Python tracker

[issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not present in code

2021-12-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +28509 pull_request: https://github.com/python/cpython/pull/30296 ___ Python tracker ___ __

[issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not present in code

2021-12-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +28508 pull_request: https://github.com/python/cpython/pull/30295 ___ Python tracker _

[issue46185] Python 3.10.1 installer refers to /Applications/Python 3.9 Install Certificates

2021-12-29 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks for the report, Jaap, and thanks Łukasz for merging :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker __

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-29 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thank you for your time, Łukasz! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue38522] Py_USING_MEMORY_DEBUGGER is referenced in docs but not present in code

2021-12-29 Thread Carlos Damazio
Carlos Damazio added the comment: Opened a PR for this issue. It'll remove the mentions to the `Py_USING_MEMORY_DEBUGGER` since it'd been removed 5 years ago. -- nosy: +carlosdamazio ___ Python tracker

[issue46194] Wrong base class for transport returned by loop.create_datagram_endpoint()

2021-12-29 Thread Carlos Damazio
Carlos Damazio added the comment: I think I have a fix for this, I opened a PR. Let me know if you have any questions. -- nosy: +carlosdamazio ___ Python tracker ___

[issue23952] cgi: Document the 'maxlen' member of the cgi module

2021-12-29 Thread Yatin Kanetkar
Change by Yatin Kanetkar : -- nosy: +yatink ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Guido van Rossum
Guido van Rossum added the comment: Could you try with 3.10 and the stdlib typing.Annotated please? There might be changes (in the past a default of None automatically caused an Optional to be added, but we changed our minds.-- --Guido (mobile) -- _

[issue22859] unittest.TestProgram.usageExit no longer invoked

2021-12-29 Thread Carlos Damazio
Carlos Damazio added the comment: Well, to this issue, I'm going to put a PR to remove it and give it a chance for it to being reinstated if you folks want to. -- nosy: +carlosdamazio -dmzz ___ Python tracker _

[issue46185] Python 3.10.1 installer refers to /Applications/Python 3.9 Install Certificates

2021-12-29 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c31fdef1e71ff1598f213b1b4ad1a565e47d7864 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-46185: Fix wrong version ref. in macOS installer ReadMe (GH-30280) https://github.com/python/cpython/commit/c31fdef1e71ff1598f213b1b4ad1a565e47d7864 -

[issue46185] Python 3.10.1 installer refers to /Applications/Python 3.9 Install Certificates

2021-12-29 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset bc87ac6d0b13116f525215f8a31b46506bc8d629 by Erlend Egeberg Aasland in branch 'main': bpo-46185: Fix wrong version ref. in macOS installer ReadMe (GH-30278) https://github.com/python/cpython/commit/bc87ac6d0b13116f525215f8a31b46506bc8d629

[issue22859] unittest.TestProgram.usageExit no longer invoked

2021-12-29 Thread Carlos Damázio
Change by Carlos Damázio : -- keywords: +patch nosy: +dmzz nosy_count: 1.0 -> 2.0 pull_requests: +28507 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30293 ___ Python tracker ___

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Tim Peters
Tim Peters added the comment: {Serhiy] > It can benefit larger arguments if move the code in > perm_comb_small(). Seems pretty clear that the newer code really belongs there instead. > And perhaps loops in perm_comb_small() could be optimized > by using precalculated values for some products

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Mehdi2277
Change by Mehdi2277 : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- pull_requests: +28506 pull_request: https://github.com/python/cpython/pull/30292 ___ Python tracker ___ __

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Did you try running that? Yes. The table size was extended beyond what we have now. See attached file. -- Added file: https://bugs.python.org/file50526/comb_with_side_limits.py ___ Python tracker

[issue46195] Annotated and Optional get_type_hints buggy interaction

2021-12-29 Thread Mehdi2277
New submission from Mehdi2277 : This is two closely related issues with get_type_hints on an optional annotated member. I'm testing with Annotated/get_type_hints from typing extensions on 3.8 and assuming they're backport equivalent to current behavior. The first issue is get_type_hints has i

[issue41593] pathlib PermissionError problem

2021-12-29 Thread Andrei Kulakov
Andrei Kulakov added the comment: Cannot reproduce on 3.9 and 3.11; the quoted fragment of code is no longer in pathlib. Closing as fixed as it seems that it was fixed in 3.9 or earlier. Please comment if you think it should be reopened. -- nosy: +andrei.avk, kj resolution: -> fixe

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think Raymond means extending the tables to TableSize=101. It can benefit larger arguments if move the code in perm_comb_small(). And perhaps loops in perm_comb_small() could be optimized by using precalculated values for some products. --

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-29 Thread Łukasz Langa
Łukasz Langa added the comment: Haha, that backport took more time than I thought :D Thanks! ✨ 🍰 ✨ -- nosy: +lukasz.langa ___ Python tracker ___ __

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Tim Peters
Tim Peters added the comment: About: TableSize = 101 limits = bytearray(TableSize) for n in range(0, TableSize): for k in range(0, n+1): if comb(n, k) != comb_small(n, k): (and regardless of whether the last line is replaced with the later correction): Did you

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Alex Waygood
Alex Waygood added the comment: I like Serhiy's idea from a type-checking perspective. It would mean we could continue to have sophisticated type inference from mypy/pyright/etc. inside singledispatch function definitions. It would also mean people could use type annotations in singledispatc

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think there is a problem in MyPy. What if use __origin__ for dispatching? Registering with parametrized generics with the same __origin__ will be error. @sigledispatch def f(a: int) -> None: pass @f.register # ok def _(a: list[int]) -> None:

[issue46187] Optionally support rounding for math.isqrt()

2021-12-29 Thread Tim Peters
Tim Peters added the comment: All cool. Since I doubt these new rounding modes will get much use anyway, it's not worth arguing about. If I were to do this for myself, the rounding argument would be one of the three values {-1, 0, +1}, which are already more than good enough as mnemonics for

[issue46194] Wrong base class for transport returned by loop.create_datagram_endpoint()

2021-12-29 Thread Carlos Damázio
Change by Carlos Damázio : -- keywords: +patch nosy: +dmzz nosy_count: 2.0 -> 3.0 pull_requests: +28505 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30291 ___ Python tracker ___

[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-29 Thread Guido van Rossum
Guido van Rossum added the comment: Let's close this issue as "won't fix" then. The solution "use collections.abc.Sequence" makes sense. -- ___ Python tracker ___ ___

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Guido van Rossum
Guido van Rossum added the comment: That mypy error is only reported with a certain mypy setting (--strict, or probably one of the specific settings that that turns on). We won't be supporting Sequence[Any] at runtime (because we only support actual types), but we should support Sequence, si

[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-29 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch nosy: +corona10 nosy_count: 4.0 -> 5.0 pull_requests: +28504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30290 ___ Python tracker _

[issue46194] Wrong base class for transport returned by loop.create_datagram_endpoint()

2021-12-29 Thread Andrew Svetlov
New submission from Andrew Svetlov : Selector-based event loops returns `_SelectorDatagramTransport` which inherits `asyncio.Transport` instead of `asyncio.DatagramTransport`. isinstance(transp, asyncio.DatagramTransport) fails. It doesn't affect the actual execution since `transp.sendto()` an

[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-12-29 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +28503 pull_request: https://github.com/python/cpython/pull/30289 ___ Python tracker ___

[issue46193] Using a dictionary for open files.

2021-12-29 Thread Keepun
Keepun added the comment: I didn't think about calculating the argument before passing it to the function... -- stage: -> resolved status: open -> closed ___ Python tracker

[issue46176] mmap module add MAP_STACK constant mostly for OpenBSD

2021-12-29 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: -corona10 stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list m

[issue46176] mmap module add MAP_STACK constant mostly for OpenBSD

2021-12-29 Thread Dong-hee Na
New submission from Dong-hee Na : New changeset 66c47b63a0df3143fe48d6efc1183eecda2a363d by David CARLIER in branch 'main': bpo-46176: mmap module adding MAP_STACK constant. (GH-30252) https://github.com/python/cpython/commit/66c47b63a0df3143fe48d6efc1183eecda2a363d -- nosy: +corona1

[issue26552] Failing ensure_future still creates a Task

2021-12-29 Thread Kumar Aditya
Change by Kumar Aditya : -- nosy: +kumaraditya303 nosy_count: 5.0 -> 6.0 pull_requests: +28502 pull_request: https://github.com/python/cpython/pull/30288 ___ Python tracker ___

[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2021-12-29 Thread Alex Waygood
Alex Waygood added the comment: I am closing this, as I believe it was fixed by the addition of **kwds to EnumMeta. Feel free to reopen this if you disagree, @retnikt. -- nosy: +AlexWaygood resolution: -> fixed stage: -> resolved status: open -> closed _

[issue46193] Using a dictionary for open files.

2021-12-29 Thread Eryk Sun
Eryk Sun added the comment: Every time open(r"test.txt", "w") is called, the existing "test.txt" file gets overwritten in the filesystem as an empty file. For each iteration, setdefault() returns a reference to the first file object, which advances its file pointer with each fh.write("\nHell

[issue26552] Failing ensure_future still creates a Task

2021-12-29 Thread Carlos Damázio
Change by Carlos Damázio : -- keywords: +patch nosy: +dmzz nosy_count: 4.0 -> 5.0 pull_requests: +28501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30287 ___ Python tracker ___

[issue38401] Make dataclass attribute docstrings accessible

2021-12-29 Thread Erik Gebeshuber
Erik Gebeshuber added the comment: There is some confusion in the answers that I want to clear up: "Attribute docstrings" were suggested in PEP 224 in August 2000 and rejected March 2001: https://www.python.org/dev/peps/pep-0224/ taleinat mentioned already PEP 258 from May 2001, which also c

[issue46193] Using a dictionary for open files.

2021-12-29 Thread Keepun
New submission from Keepun : """ Using a dictionary for open files. The file is filled with NULL. Only the last entry is normal. Result: 00 00 00 00 ... 00 0A 48 65 6C 6C 6F 0A Ubuntu - 3.8.10 Windows - 3.9.8 """ fhandles = {} for f in range(100): fh = fhandles.setdefault("suffix", open(r

[issue30420] [doc] subprocess module: Clarify kwarg handing for convenience APIs

2021-12-29 Thread Alex Waygood
Change by Alex Waygood : -- title: Clarify kwarg handing for subprocess convenience APIs -> [doc] subprocess module: Clarify kwarg handing for convenience APIs ___ Python tracker

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-29 Thread Alex Waygood
Change by Alex Waygood : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

2021-12-29 Thread miss-islington
miss-islington added the comment: New changeset ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1 by Miss Islington (bot) in branch '3.10': [3.10] bpo-46120: State that `|` is preferred over `Union` (GH-30222) (GH-30250) https://github.com/python/cpython/commit/ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was assigned to a variable initially because it was used in multiple places. Now it is only used in one place, but I agree with keeping the variable for readability. But it should be named _IGNORED_ERRNOS. -- __

[issue46190] Omit k in random.sample()

2021-12-29 Thread Tilman Krummeck
Tilman Krummeck added the comment: Hmm, ok, that sounds obvious. Thanks for the clarification. -- ___ Python tracker ___ ___ Python

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood, lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46192] Optimize builtin functions min() and max()

2021-12-29 Thread colorfulappl
Change by colorfulappl : -- keywords: +patch pull_requests: +28500 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30286 ___ Python tracker ___ ___

[issue46192] Optimize builtin functions min() and max()

2021-12-29 Thread colorfulappl
Change by colorfulappl : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue46192] Optimize builtin functions min() and max()

2021-12-29 Thread colorfulappl
New submission from colorfulappl : https://github.com/faster-cpython/ideas/discussions/199 -- components: Interpreter Core messages: 409299 nosy: colorfulappl priority: normal severity: normal status: open title: Optimize builtin functions min() and max() versions: Python 3.11

[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: - if comb(n, k) != comb_small(n, k): + if comb(n, k) != comb_small(n, k) % Modulus: -- ___ Python tracker ___

[issue43639] Do not raise AttributeError on instance attribute update/deletion if data descriptor with missing __set__/__delete__ method found on its type

2021-12-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue43639] Do not raise AttributeError on instance attribute update/deletion if data descriptor with missing __set__/__delete__ method found on its type

2021-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm going to decline this one. * It is arguable whether or not this behavior should have been designed in originally. However, changing it now is risky (as noted by Brett and Ethan). * Personally, I disagree with the notion of allowing a partial pass t

[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The original issue is about dispatching on non-parametrized generics like typing.Sequence. isinstance([], typing.Sequence) works, so it could be possible to support dispatching on typing.Sequence. But I have doubts that it is worth to revive such feature,

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : You can dispatch on collections.abc.Sequence. @functools.singledispatch def f(a: collections.abc.Sequence) -> None: pass But MyPy complains about this: error: Missing type parameters for generic type "Sequence" MyPy requires parametrized generic (li

[issue46187] Optionally support rounding for math.isqrt()

2021-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > So use decimal's ROUND_CEILING, ROUND_FLOOR, and ROUND_HALF_EVEN It think is would suck to have to type those out. Sorry, I think you're headed down the path of foolish consistency with an unrelated module and a more complicated topic. What's wrong wi

[issue46190] Omit k in random.sample()

2021-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: The use case isn't bizarre. But having an API where that is the default behavior would be. From the point of view of most users, such an API would be unusual and surprising (I don't know of any other random package that has such a default). --