[issue43613] gzip.compress and gzip.decompress are sub-optimally implemented.

2021-03-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43613> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43198] One operation on sets < 1/100th as efficient in 3.9 than before

2021-03-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +23767 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25010 ___ Python tracker <https://bugs.python.org/issu

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue43535> ___ ___ Python-bugs-

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker <https://bugs.python.org/issue43602> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- Removed message: https://bugs.python.org/msg389373 ___ Python tracker <https://bugs.python.org/issue43602> ___ ___ Python-bug

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: We don't have a choice here. Operations between decimals and floats raise a TypeError. So, we can't register Decimal as a Real; otherwise, static type checking wouldn't be able to flag the following as invalid: def add(a: Real, b

[issue43602] Include Decimal's in numbers.Real

2021-03-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: We don't have a choice here. Operations between decimals and floats raise a TypeError. So, we can't register Decimal as a Real; otherwise, static type checking wouldn't be able to flag the following as invalid: def add(a: Real, b

[issue43347] IDLE crashes in macOS Apple chip, maybe completions

2021-03-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: This time I got a screen shot showing the gray completion box that appeared just as IDLE stopped responding and froze: https://www.dropbox.com/s/eu3wd13vytz6tt8/Screen%20Shot%202021-03-22%20at%209.37.56%20PM.png?dl=0 Am now running Python 3.10.0a6 on Big

[issue35118] Add peek() or first() method in queue

2021-03-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: >> FWIW, the standard library queue module doesn't have >> a straight-forward way to implement a peek() method. > I currently use `q.deque[0]` The Queue class is only allowed to call _init, _qsize, _put, and _get. It is not allow

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

2021-03-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning because I haven't been able to make time for this one. -- assignee: rhettinger -> ___ Python tracker <https://bugs.python.org

[issue26680] Incorporating float.is_integer into Decimal

2021-03-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- components: -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, Cross-Build, Demos and Tools, Distutils, Documentation, Extension Modules, asyncio, ctypes nosy: -Alex.Willmer, asvetlov, dstufft, eric.araujo, larry, yselivanov type

[issue26680] Incorporating float.is_integer into Decimal

2021-03-21 Thread Raymond Hettinger
Change by Raymond Hettinger : Removed file: https://bugs.python.org/file49898/Mobile_Signup.vcf ___ Python tracker <https://bugs.python.org/issue26680> ___ ___ Python-bug

[issue43581] array assignment error

2021-03-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42914] pprint numbers with underscore

2021-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think underscores can be on by default. It needs to be opt-in to be backwards compatible. -- ___ Python tracker <https://bugs.python.org/is

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I'm running a user poll on Twitter and have asked people to state their rationale: https://twitter.com/raymondh/status/1373315362062626823 Take it with a grain of salt. Polls totals don't reflect how much thought each person put

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Of 721 uses of the join() method (excluding os.path.join()) > in the stdlib, only 10 need forceful stringification with > map(str, ...) Thanks for looking a real world code. I'm surprised that the standard library stats aren't r

[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Currently, super() is decoupled from the core language. It is just a builtin that provides customized attribute lookup. This PR makes super() more tightly integrated with the core language, treating it as if it were a keyword and part of the grammar

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +23703 pull_request: https://github.com/python/cpython/pull/24944 ___ Python tracker <https://bugs.python.org/issue40

[issue43566] Docs say int('010', 0) is not legal, but it is

2021-03-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue43566> ___ ___ Python-bugs-

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Dr Racket supports fraction conversions but insists on a forward slash just like we do. Welcome to DrRacket, version 7.9.0.17--2020-12-24(f6b7f93/a) [cs]. Language: racket, with debugging; memory limit: 128 MB. > (/ 1 2) 1/2 > (string->number &

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't have a PR in-hand. I just ran across this when trying to explain 3.9 vs 3.10 timings and M-1 vs Intel timings. Ideally, all of these PRs should be reverted. Short of that, each change needs to be reviewed to see if it created extra

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: > What changed? It comes up almost every week that I teach a Python course. Eventually, I've come to see the light :-) Also, I worked though the steps and found an efficiency gain for new code with no detriment to existing code. Lastly, I

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2021-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Thanks Raymond, I fixed the code. Can you fix all the other cases where this is used in inner-loop; otherwise, it is undoing everyone else's optimizations and fast paths. Also, it seems the that primary motivation for this is support subinte

[issue43532] Add keyword-only fields to dataclasses

2021-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for this idea. I don't see any downside. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/is

[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2021-03-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> docs@python components: +Documentation -Windows nosy: +docs@python type: performance -> behavior ___ Python tracker <https://bugs.python.org/i

[issue43535] Make str.join auto-convert inputs to strings.

2021-03-17 Thread Raymond Hettinger
New submission from Raymond Hettinger : Rather than just erroring-out, it would be nice if str.join converted inputs to strings when needed. Currently: data = [10, 20, 30, 40, 50] s = ', '.join(map(str, data)) Proposed: s = ', '.join(data) That would sim

[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43521> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Shouldn't this wait to see if the subinterpreters PEP is approved? Because if it isn't, then no chance should be made. We shouldn't change something this fundamental without good cause. -- nosy: +pablog

[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Be careful about performance. We know for sure that macros will inline. In contrast, inline functions might or might not inline (there are rules for when it can be done). When applied across source files, inlining often only occurs with an LTO build

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think we should stick the with forward slashes. That is what the rest of the language does. Adding more options is recipe for confusion. >>> 38 / 5 7.6 >>> 38 ∕ 5 SyntaxError: invalid character '∕' (U+2215)

[issue41361] Converting collections.deque methods to Argument Clinic

2021-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the PR :-) -- ___ Python tracker <https://bugs.python.org/issue41361> ___ ___ Python-bugs-list mailing list Unsub

[issue41361] Converting collections.deque methods to Argument Clinic

2021-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 448801da96c70699e2ca0798efdfe86d45f37f06 by Dennis Sweeney in branch 'master': bpo-41361: Optimized argument parsing for deque_rotate (GH-24796) https://github.com/python/cpython/commit/448801da96c70699e2ca0798efdfe8

[issue43080] pprint for dataclass instances

2021-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, we've not had a feature request for this ever, nor has there been a request for pprint to support attrs, nor any other hand-rolled class that implements methods similar to those generated by dataclasses. AFAICT, this tracker issue wasn't

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: > And making float('nan') returning a singleton, > but 1e1000 * 0 returning different NaN would cause large confusion. Not really, it would be just be an implementation detail, no different than int and strings being sometimes unique a

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The performance thoughts were motivated by the idea of > making NaN a singleton: adding a check to > PyFloat_FromDouble would mean that almost every operation > that produced a float would have to pass through that check. It may suffice

[issue1283110] Give __len__() advice for "don't know"

2021-03-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Looking at the patch years later, I'm thinking that this isn't needed or helpful. Not needed because users haven't reported any misunderstandings in the interim. Not helpful because the text looks forbidding and impenetrable, too mu

[issue43245] Add keyword argument support to ChainMap.new_child()

2021-03-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43245] Add keyword argument support to ChainMap.new_child()

2021-03-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 9923df96413a0b480a34ec1d537b66ca0eeb0fdc by Kamil Turek in branch 'master': bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788) https://github.com/python/cpython/commit/9923df96413a0b480a34ec1d537b66

[issue43490] IDLE freezes at random

2021-03-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Are on an Intel processor or Apple Silicon? -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43

[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker <https://bugs.python.or

[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 45d9c8cda3db7da9fe209bd215ec9a120265ee65 by Miss Islington (bot) in branch '3.9': bpo-43427: Separte the method overview from the static method specifics. (GH-24787) (GH-24849) https://github.com/python/cpyt

[issue43427] Possible error on the descriptor howto guide

2021-03-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a by Raymond Hettinger in branch 'master': bpo-43427: Separte the method overview from the static method specifics. (GH-24787) https://github.com/python/cpyt

[issue43488] Added new methods to vector.py

2021-03-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think this should be added. The whole point of vector.py was to be a simple educational demo of a Python class its special methods work. It was not intended to grow more features or ever be used in production. Also, vector-to-v

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-03-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Idea: We could make this problem go away by making NaN a singleton. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43467] IDLE: horizontal scrollbar

2021-03-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I think IDLE is better-off without a horizontal scroll bar. For teaching purposes, it's valuable to a screen that focuses on content and is devoid of clutter. -- nosy: +rhettinger ___ Python tr

[issue43443] Should shelve support dict union?

2021-03-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought. While __ior__() could be used as a short-cut for update(), the related __or__() method is more problematic because it would need to create a new underlying DB. So maybe this is a can worms that we should not open. It would be weird

[issue43443] Should shelve support dict union?

2021-03-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Maybe say that they implement the MutableMapping interface? Yes, that's a good idea (also add link to the MutableMapping docs). > Right, that seems like a good idea. But `__ior__` could > be implemented nevertheless? Off-hand, I don

[issue43198] Operations on sets more than hundred times less efficient with python3.9 than with previous versions

2021-03-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've had misgivings about this and will revert the change for Python 3.10. Usually, it is safe for sets to implement whatever has been battle-tested with dicts, but sets should aspire to do better for alternating deletions and re-additions of the

[issue35118] Add peek() or first() method in queue

2021-03-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I want to examine the first (oldest) element in queue and > remove it if it's too old. Why not just dismiss older queue entries during a normal get() operation? Or just use a plain deque with access guarded by a lock. FWIW, the standard li

[issue41361] Converting collections.deque methods to Argument Clinic

2021-03-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Go ahead with in-lining the argument handling for rotate(). The no argument form and the +1 and the -1 case are important enough to warrant the change. Please skip index() and insert() which aren't essential methods. Also, those methods aren

[issue43427] Possible error on the descriptor howto guide

2021-03-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +23553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24787 ___ Python tracker <https://bugs.python.org/issu

[issue43427] Possible error on the descriptor howto guide

2021-03-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I can see how that section intro is a bit confusing. Am thinking it will be more clear if the heading "Static Methods" is to moved to just after the table showing the three variants. Otherwise, it looks like the intro text is talking specific

[issue43427] Possible error on the descriptor howto guide

2021-03-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker <https://bugs.python.org/issue43427> ___ ___ Python-bugs-list mai

[issue43436] bounded _lru_cache_wrapprer behaves as if typed=True when it wasn't

2021-03-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report, but this isn't a bug. Setting typed=True guarantees that types are treated as distinct entries. Setting typed=False means that the implementation MAY ignore the type and only use equality, but it is not required to do so.

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: > 1 loop, best of 11: 257 msec per loop > $ ... from patched ... > 10 loops, best of 11: 33.2 msec per loop Looks worth it :-) -- ___ Python tracker <https://bugs.python.or

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Without the guards the incremental cost drops to 10%. $ python3.10 -m timeit -r11 -s 'from patched_noguards import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 1000

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The cost to the common case for small components is about 20%: $ python3.10 -m timeit -r11 -s 'from fractions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 20 loops, best of 11: 1.8 usec per lo

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note that Fraction arithmetic has a huge administrative overhead. The cost of the underlying multiplications and divisions won't dominate the total time until the numerators and denominators are very large. For the proposed optimization, this im

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's some code to try out: from math import gcd from fractions import Fraction import operator import math class Henrici(Fraction): 'Reformulate _mul to reduce the size of intermediate products' # Original has 2 multiplicatio

[issue43422] Revert _decimal C API changes

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 fron me. -- ___ Python tracker <https://bugs.python.org/issue43422> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue43413> ___ ___ Python-bugs-list mailing list Unsub

[issue30469] Inconsistent Execution of Generic Descriptor Attributes

2021-03-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue30469> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43300] "bisect" module should support reverse-sorted sequences

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you for the suggestion, but am going close this for the reasons mentioned above. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue43400] Improve recipes and howtos for the unittest.mock

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: Renaming this issue to reflect a shift in focus towards broader improvements to the documentation. -- title: Remove "Mock is very easy to use" from unittest.mock documentation -> Improve recipes and howtos for the unittest.mock versi

[issue43400] Improve recipes and howtos for the unittest.mock

2021-03-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker <https://bugs.python.org/issue43400> ___ ___ Python-bugs-list mailing list Un

[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 0dd4cb944b497dc6bd0b3763e461d72e9a7b6490 by Miss Islington (bot) in branch '3.9': bpo-43400: Remove "easy to use" from mock docs (GH-24752) (GH-24758) https://github.com/python/cpython/commit/0dd4cb944b497dc6bd0b

[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +lukasz.langa ___ Python tracker <https://bugs.python.org/issue43399> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker <https://bugs.python.org/issue43400> ___ ___ Python-bugs-list mai

[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 2122e486307d5577cb5fb5e7cfd24095695bc7e9 by Eddie Peters in branch 'master': bpo-43400: Remove "easy to use" from mock docs (GH-24752) https://github.com/python/cpython/commit/2122e486307d5577cb5f

[issue43399] xml.etree.ElementTree.extend does not work with iterators when using the Python implementation

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for back porting, but check with the RM first. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43

[issue43400] Remove "Mock is very easy to use" from unittest.mock documentation

2021-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for the OP's suggestion. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43400> ___ ___ Pytho

[issue43393] Older Python builds are missing a required file on Big Sur

2021-03-03 Thread Raymond Hettinger
New submission from Raymond Hettinger : When I upgraded to Big Sur, all my older builds stopped working. Do we have any known workarounds or can we publish updated builds that work? Like a lot of consultants, I still have to help clients maintain older code. Having a standard working build

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +Daniel Moisset, brandtbucher, gvanrossum, willingc ___ Python tracker <https://bugs.python.org/issue43378> ___ ___ Pytho

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Should __match_args__ be added to Objects/structseq.c ? -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue42

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another other thought, PEP 634 defines "|" as being an "or-pattern", so it part of the spec: https://www.python.org/dev/peps/pep-0634/#or-patterns -- ___ Python tracker <https://bug

[issue43378] Pattern Matching section in tutorial refers to | as or

2021-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems fine to me. In pattern matching, it has both the meaning and pronunciation of "or": case "this" | "that": ... It has similar mean in the re module: r'abc|def' And it is also used the same w

[issue43347] IDLE crashes in

2021-02-28 Thread Raymond Hettinger
New submission from Raymond Hettinger : I'm running a python.org Mac build on Apple silicon. Python 3.10.0a5 (v3.10.0a5:b0478d738a, Feb 2 2021, 16:30:44) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Periodically, Python freezes and requires a force quit. I'm not certain but

[issue40469] TimedRotatingFileHandler rotating on use not time

2021-02-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +vinay.sajip ___ Python tracker <https://bugs.python.org/issue40469> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43344] RotatingFileHandler breaks file type associations

2021-02-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 The ability to customize the filenames seems like a reasonable feature request. Perhaps an optional *format* option could introduced. -- nosy: +rhettinger, vinay.sajip versions: +Python 3.10 ___ Python

[issue43343] argparse.REMAINDER missing in online documentation for 3.9.x

2021-02-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Chigozirim, thanks for the report. REMAINDER is now an undocumented legacy feature. It isn't deprecated because we don't plan to remove it. It isn't documented because it is buggy in a way that isn't easy to fix. -- resol

[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is a bit out of date. The isinstance() docs now specify that the predicate tests for direct, indirect, and virtual inheritance. Likewise, the super() docs already specify that only the __mro__ is searched. So those docs are already precise. Am

[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll add a note to this effect in the tutorial. Also, in the FAQ, we could have an entry about the three circumstances when "is" can relied upon: 1) variable assignment doesn't change identity, 2) containers that use references d

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Normally, we don't (or can't) enumerate all possible exceptions. But in this case, it is worth expanding the documentation so that person can know which of two common input errors they need to catch: "If the data being deserialized is no

[issue43060] Convert _decimal C API from pointer array to struct

2021-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > In my opinion, an array of pointers is a bad API; The existing code is how types were made for most of Python's history. It is not "bad"; it is just more wordy. Given that the current code is correct, I don't see any strong r

[issue43341] functools.partial missing __weakref__ descriptor?

2021-02-27 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43341> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Josh and will mark this as closed. It is unfortunate, but the time to get an API right is before it lands, not years after people have come to depend on it. -- nosy: +rhettinger resolution: -> wont fix stage: -> resolved

[issue43300] "bisect" module should support reverse-sorted sequences

2021-02-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: I prefer option 5 and leaving the module as-is. The bisect module api is slice oriented and, in general, people have a hard time reasoning about slices for reverse ordered sequences. Even the forward ordered API is a bit awkward so that we had to

[issue43293] Move note about GIL to top of threading module

2021-02-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue43293> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43287] Use PEP 590 vectorcall to speed up calls to filter()

2021-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I don't think there is much of a maintenance burden; hence, the +0. You've already done the work. -- ___ Python tracker <https://bugs.python.o

[issue15108] Incomplete tuple created by PyTuple_New() and accessed via the GC can trigged a crash

2021-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unless there is a simple, reliable, cheap, and universal solution at hand, consider closing this. Given how long PyTuple_New() has exist, it doesn't seem to be much of a problem in the real world. Historically, we punted on "crashers" i

[issue43287] Use PEP 590 vectorcall to speed up calls to filter()

2021-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Happy new year to you as well :-) -- ___ Python tracker <https://bugs.python.org/issue43287> ___ ___ Python-bugs-list mailin

[issue43250] [C API] Deprecate or remove PyFPE_START_PROTECT() and PyFPE_END_PROTECT()

2021-02-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- title: [C API] Depreate or remove PyFPE_START_PROTECT() and PyFPE_END_PROTECT() -> [C API] Deprecate or remove PyFPE_START_PROTECT() and PyFPE_END_PROTECT() ___ Python tracker <https://bugs.python.org/issu

[issue43291] elementary multiplication by 0.01 error

2021-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here is an explanation for the behavior you're seeing: https://docs.python.org/3/tutorial/floatingpoint.html Here is another famous resource on the subject: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html For exact de

[issue43287] Use PEP 590 vectorcall to speed up calls to filter()

2021-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: +0 I don't see any downside. Note, the benchmark only times instantiation of the filter object. It doesn't actually run the iterator which is where most of the runtime cost is spent. So in actual code there is almost zero benefit. For ex

[issue43245] Add keyword argument support to ChainMap.new_child()

2021-02-17 Thread Raymond Hettinger
New submission from Raymond Hettinger : This would it more convenient to extend chains for local contexts. Currently, we write: local = parent.new_child(dict(foreground='white', background='cyan')) Instead, it would be easier to write: local = parent.new_chi

[issue43243] Strict ABC classes

2021-02-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Why is this needed? Already, instantiation is blocked. -- nosy: +gvanrossum, rhettinger ___ Python tracker <https://bugs.python.org/issue43

[issue43198] Operations on sets more than hundred times less efficient with python3.9 than with previous versions

2021-02-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Addenda [reposted to fix a premature submission]. Top use cases for sets (roughly in order of commonality): 1. Eliminate duplicates from an iterable input and loop over the result. 2. Store elements in a set just once but do many membership tests. 3

[issue43198] Operations on sets more than hundred times less efficient with python3.9 than with previous versions

2021-02-11 Thread Raymond Hettinger
Change by Raymond Hettinger : -- Removed message: https://bugs.python.org/msg386847 ___ Python tracker <https://bugs.python.org/issue43198> ___ ___ Python-bug

[issue43198] Operations on sets more than hundred times less efficient with python3.9 than with previous versions

2021-02-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Addenda. Top use cases for sets (roughly in order of commonality): 1. Eliminate duplicates from an iterable input and loop over the result. 2. Store elements in a set just once but do many membership tests. 3. Perform data analysis on multiple sets using

[issue43198] Operations on sets more than hundred times less efficient with python3.9 than with previous versions

2021-02-11 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker <https://bugs.python.org/issue43198> ___ ___ Python-bugs-list mailing list Un

<    5   6   7   8   9   10   11   12   13   14   >