[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Why is not PEP 630 enough? My understanding is that this entire class of code changes has been put on hold pending Steering Council approval. It represents a great deal of code churn and creation on new APIs. Several of the patches had had negat

[issue45530] Improve listobject.c's unsafe_tuple_compare()

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

[issue42222] Modernize integer test/conversion in randrange()

2021-10-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 5afa0a411243210a30526c7459a0ccff5cb88494 by Raymond Hettinger in branch 'main': bpo-4: Remove deprecated support for non-integer values (GH-28983) https://github.com/python/cpython/commit/5afa0a411243210a30526c7459a0cc

[issue45491] help() is too noisy for types used like functions

2021-10-15 Thread Raymond Hettinger
New submission from Raymond Hettinger : When someone requests help(range), help(zip), help(property), or help(classmethod), the expectation and need is to see something like what is shown in main documentation rather than being subjected to a listing of every standard dunder method. It

[issue42222] Modernize integer test/conversion in randrange()

2021-10-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +27270 pull_request: https://github.com/python/cpython/pull/28983 ___ Python tracker <https://bugs.python.org/issue42

[issue45483] pure Python class that has been registered as a `collections.abc.Sequence` can't be recgnized by the match statement without the `_abc` module

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

[issue45476] [C API] Convert "AS" functions, like PyFloat_AS_DOUBLE(), to static inline functions

2021-10-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: > These macros can be abused to be used as l-value You could simply document, "don't do that". Also if these is a need to make an assignment, you're now going to have to create a new setter function to fill the need. We really d

[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Evgeniy, please leave this closed and take the proposal to the python-ideas mailing list. There is no further progress that can be made in this tracker issue. We can’t discern any part of your proposal that would make sense for improving the language

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: It looks like the error is in inspect.formatannotation(). For instances of type, that function incorrectly returns only annotation.__qualname__. Instead, it should return repr(annotation) which would include the args

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-11 Thread Raymond Hettinger
New submission from Raymond Hettinger : In the example below, __annotations__ is correct but not the corresponding Signature object. --- from typing import List def f(s: List[float]) -> None: pass def g(s: list[fl

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: It may have been a mistake to allow this kind of decorator chaining. * As Randolf and Alex have noticed, it invalidates assumptions made elsewhere in the standard library and presumably in third-party code as well. * And as Randolf noted in his last

[issue44904] Classmethod properties are erroneously "called" in multiple modules

2021-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Moving this discussion to issue 45356 because some of the discussion would need to be duplicated. -- nosy: +rhettinger resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Calling `he

[issue45356] Calling `help` executes @classmethod @property decorated methods

2021-10-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm merging issue 44904 into this one because they are related. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/is

[issue45378] Can't find "map" with search on docs.python.org

2021-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm surprised no one else noticed this until now. The doc search finds some entries such as: "sum", "min", "max", and "enumerate". However, it is missing others such as: &quo

[issue45302] 10 built-in functions need non-None .__text_signature__

2021-10-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: As Serhiy says, this is a known issue that we can't do anything about until signature objects become more expressive. The C code already has comments such as: /* AC: cannot convert yet, waiting for *args support */ /* AC: cannot conver

[issue45352] Move documentation for typed generic forms of standard collections to collections.abc

2021-10-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Where are capabilities like "list[str]" and "dict[str, list[int]]" going to be documented? -- ___ Python tracker <https://bug

[issue44674] dataclasses should allow frozendict default value

2021-10-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Eric] > I agree that there's no good way of telling if an > arbitrary class is immutable, so I'm not sure we can > do anything here. Consider using non-hashability as a proxy indicator for immutability. - isinstance(f.defaul

[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-10-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Related: https://bugs.python.org/issue45347 -- ___ Python tracker <https://bugs.python.org/issue44831> ___ ___ Python-bug

[issue45347] datetime subject to rounding?

2021-10-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Related: https://bugs.python.org/issue44831 -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue45

[issue45346] Some "truthy" crept in

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

[issue45346] Some "truthy" crept in

2021-10-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 72089f33c0aed391f047b1cbaf19d8da1e51c167 by Miss Islington (bot) in branch '3.10': bpo-45346: Keep docs consistent regarding true and false values (GH-28697) (GH-28698) https://github.com/python/cpyt

[issue45346] Some "truthy" crept in

2021-10-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset db91b058d5d4fbff4185982095d90fe6a2741aed by Raymond Hettinger in branch 'main': bpo-45346: Keep docs consistent regarding true and false values (GH-28697) https://github.com/python/cpython/commit/db91b058d5d4fbff4185982095d90f

[issue45346] Some "truthy" crept in

2021-10-02 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +27056 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28697 ___ Python tracker <https://bugs.python.org/issu

[issue45346] Some "truthy" crept in

2021-10-02 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger type: enhancement -> ___ Python tracker <https://bugs.python.org/i

[issue45313] Counter.elements() wrong error message

2021-09-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: The elements() method is working correctly: >>> from collections import Counter >>> aCounter = Counter('abracadabra') >>> list(aCounter.elements()) ['a', 'a', 'a', 'a&

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Given that there isn't an actual bug here, please move this discussion to python-ideas. -- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python t

[issue45293] List inplace addition different from normal addition

2021-09-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Kapil, this behavior was intentional (not a bug), but later regarded as a design mistake. GvR has said that if he had to do it over again list.__iadd__ would only accept other lists. The problem arises when people write "somelist += 'hello&#x

[issue45271] Add a 'find' method (a'la str) to list

2021-09-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is one bit of symmetry that we shouldn't pursue. The find() methods have been a recurring source of bugs because of failing to check for a -1 result but having that be a valid index into the sequence. Also, the sequence APIs are long establ

[issue39549] The reprlib.Repr type should permit the “fillvalue” to be set by the user

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

[issue39549] The reprlib.Repr type should permit the “fillvalue” to be set by the user

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 8c21941ddafdf4925170f9cea22e2382dd3b0184 by Alexander Böhn in branch 'main': bpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343) https://github.com/python/cpython/commit/8c21941ddafdf4925170f9cea22e23

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Overall, I expect the improved sharing to more than > compensate for the disadvantages. I expect the opposite. This makes all dicts pay a price (in space, initialization time, and complexity) for a micro-optimization of an uncommon case (the

[issue45265] Bug in append() method in order to appending a temporary list to a empty list using for loop

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is expected behavior. To get a better understanding, see: https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x To get help writing correct code, please do not use the bug tracker. Consider posting to

[issue45259] No _heappush_max()

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: The underscore functions are private and for internal use. There is no _heappush_max() because we didn't need it internally and it would just be dead code. Thanks for the report. -- resolution: -> not a bug stage: -> resolved s

[issue45246] the sorted() documentation should refer to operator

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

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 9a0dcc5b2e04d9c51350107734f12a1cbc0284a7 by Raymond Hettinger in branch 'main': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/9a0dcc5b2e04d9c51

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Thank you for looking into this. You're welcome :-) > Would it make sense to change list.sort() in the same way? I think not. This is a such a minor point and is a distractor. Most users would be better off focusing on the

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +26889 pull_request: https://github.com/python/cpython/pull/28494 ___ Python tracker <https://bugs.python.org/issue45

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I created a PR from my last patch, inlining the unpacking > of single digit integers. Thanks, that gets to the heart of the issue. I marked the PR as approved (though there is a small coding nit you may want t

[issue45246] the sorted() documentation should refer to operator

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 on this. While it is true that __lt__ is used, we don't really want people to exploit that fact. Doing so will get them into trouble elsewhere. For example, max(seq) uses __gt__. Also, when mixing types, a return of NotImplemented will trig

[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: False alarm. I misread the diff. All is well. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-09-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: fixed -> status: closed -> ___ Python tracker <https://bugs.python.org/issue34451> ___ ___ Python-bugs-list

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-09-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- Removed message: https://bugs.python.org/msg402274 ___ Python tracker <https://bugs.python.org/issue34451> ___ ___ Python-bug

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: False alarm. I misread the diff. All is well. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45155] Add default arguments for int.to_bytes()

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 9510e6f3c797b4398aaf58abc1072b9db0a644f9 by Raymond Hettinger in branch 'main': bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465) https://github.com/python/cpython/commit/9510e6f3c797b4398aaf58abc1072b

[issue45155] Add default arguments for int.to_bytes()

2021-09-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +26879 pull_request: https://github.com/python/cpython/pull/28465 ___ Python tracker <https://bugs.python.org/issue45

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: > OTOH on my Mac I still find that 3.10 with PGO is still > more than twice as slow than 2.7. > Thinking about it that's a bit odd, since (presumably) > the majority of the work in sum() involves a long int result > (even though th

[issue45213] Frozen modules are looked up using a linear search.

2021-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: If you close this out, consider adding a prominent comment so that the issue will be on the minds of people looking at this code. -- nosy: +rhettinger status: pending -> open ___ Python tracker <

[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2021-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also a test should be added to make sure the weakref callbacks are still occurring. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39778] collections.OrderedDict and weakref.ref raises "refcount is too small" assertion

2021-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm thinking that edit to tp_dealloc was incorrect. The PyClear call should have been replaced (not removed) with the pattern shown in the C APIs docs ( https://docs.python.org/3/extending/newtypes.html?highlight=pyobject_clearw#weak-reference-su

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Ma Lin. -- ___ Python tracker <https://bugs.python.org/issue45116> ___ ___ Python-bugs-list mailing list Unsub

[issue39549] The reprlib.Repr type should permit the “fillvalue” to be set by the user

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

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Is the subinterpreters work still on hold pending a PEP? I thought that conversions to heap types had been suspended because there is a Steering Council level cost benefit decision. Mostly it seems that everything helps subinterpreters makes code worse

[issue45216] Remove redundand information from difflib docstrings

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

[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

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

[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 94b462686b7dfabbd69cc9401037d736d71c4dc2 by Raymond Hettinger in branch 'main': bpo-45198: __set_name__ documentation not clear about its usage with non-descriptor classes (GH-28439) https://github.com/python/cpyt

[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a18d52269ab6071a605d6c72f6af585a4c533ca4 by Miss Islington (bot) in branch '3.9': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28443) https://github.com/python/cpyt

[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 6e4101add568910409294554c8e863226a66bb64 by Miss Islington (bot) in branch '3.10': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) (GH-28442) https://github.com/python/cpyt

[issue45235] argparse does not preserve namespace with subparser defaults

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a6e8db5e8e6780411db749d404715dbe021647c7 by Adam Schwalm in branch 'main': bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) https://github.com/python/cpython/commit/a6e8db5e8e6780411db749d404715d

[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Raymond, do you think we should also freeze the dependencies > of runpy (so "python -m " also starts faster)? Yes, please. The '-m' load option can be considered core startup functionality. It is often the recommended

[issue45020] Freeze all modules imported during startup.

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be nice to freeze argparse.py and its dependencies. For command-line tools, startup time is important. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue45

[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +26844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28439 ___ Python tracker <https://bugs.python.org/issu

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Pablo, should this be a release blocker? -- nosy: +lemburg, pablogsal ___ Python tracker <https://bugs.python.org/issue45

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Right now, I'm not sure. The heuristic to decide > if a function is inlined or not seems to depend > a lot on the compiler and the compiler options. That is exactly correct. And it is why we should use the macro form which is certain

[issue43413] tuple subclasses allow arbitrary kwargs

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Subclass of set can now define a __new__() method with > additional keyword parameters without overriding also __init__(). Is there any use case for this? Offhand, I can't think of any reason. The new code in set.__init__ is somewhat op

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Confirmed that this weird behavior is still present. Am not sure when someone will have the time and inclination to drill into the cause. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

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

[issue43574] Regression in overallocation for literal list initialization in v3.9+

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

[issue45225] use map function instead of genexpr in capwords

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the PR. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45225] use map function instead of genexpr in capwords

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a59ede244714455aa9ee8637608e019a20fa2ca6 by speedrun-program in branch 'main': bpo-45225: use map function instead of genexpr in capwords (GH-28342) https://github.com/python/cpython/commit/a59ede244714455aa9ee8637608e01

[issue45224] Argparse shows required arguments as optional

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: In Python3.10, "optional arguments" has been replaced with "options". We didn't backport the change because it risks breaking tests that rely on exact string matches. Also, it was really a bug, it was just an unfortunate ch

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: These should be changed back to macros where inlining is guaranteed. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45198] __set_name__ documentation not clear about its usage with non-descriptor classes

2021-09-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: You are correct that __set_name__ works for non-descriptor classes as well. The docs for it should be moved out of the "Implementing Descriptors" section. Also, it should have a non-descriptor example. -- assignee: docs@python -> rh

[issue45197] IDLE should suppress ValueError for list.remove()

2021-09-14 Thread Raymond Hettinger
New submission from Raymond Hettinger : I got this today running a stock Python 3.9.6 for macOS downloaded from python.org. - Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.

[issue45155] Add default arguments for int.to_bytes()

2021-09-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Just reread the thread. AFAICT not a single use case was presented for having system byte ordering as the default. However, multiple respondents have pointed out that a default to system byte ordering is a bug waiting to happen, almost ensuring that

[issue45155] Add default arguments for int.to_bytes()

2021-09-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Interestingly, "little" is faster than "big". $ python3.10 -m timeit -r11 -s 'x=3452452454524' 'x.to_bytes(10, "little")' 500 loops, best of 11: 82.7 nsec per loop $ python3.10 -m timeit -r11 -s '

[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Mark Dickinson] > I'd also really like to avoid a system-dependent default. [Petr Viktorin] > Exactly, a platform-dependent default is a bad idea. I concur with Petr and Mark. The principal use case for int.to_bytes is to convert an

[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy is likely thinking of other the other cases. Prior to this discussion, the principal use for to_bytes and from_bytes was for integers larger than a single byte. If we're going to add a *byteorder* default, it needs to make sense for those

[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 ___ Python tracker <https://bugs.python

[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) in branch '3.10': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) (GH-28266) https://github.com/python/cpyt

[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 89edd18779e382c5fa7f57722b0b897a907ed2c4 by Miss Islington (bot) in branch '3.10': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) (GH-28266) https://github.com/python/cpyt

[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in branch 'main': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) https://github.com/python/cpyt

[issue45024] Cannot extend collections ABCs with protocol

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 62fa613f6a6e872723505ee9d56242c31a654a9d by Raymond Hettinger in branch 'main': bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs (GH-28218) https://github.com/python/cpyt

[issue45155] Add default arguments for int.to_bytes()

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Perhaps instead of the system byte ordering, choose one for the default so that default encoding/decoding will work cross platform. I think "little" is the most common (intel and arm). -- nosy: +

[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Idea for improving unmarshalling speed: Since reading PYCs is I/O bound, it may be worthwhile to compress them. When the idea came up previously, Antoine suggested choosing an algorithm with the fastest possible decompression speed (iirc, it was lzma4

[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the link. This is a worthwhile experiment. However, the potential gains will be hard to come by. The workload of LOAD_CONST is very small. After paying for the usual dispatch logic overhead, all it does is an index into a struct member and

[issue45152] Prepare for splitting LOAD_CONST into several opcodes

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I didn't know this was in the works. Can you point me to the relevant discussion about why LOAD_CONST would be split? -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/is

[issue44344] Documentation for pow() should include the possibility of complex numbers as a return type

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: The pow() docs could use substantial updating. All of the logic for pow() is implemented in base.__pow__(exp, [mod]). Technically, it isn't restricted to numeric types, that is just a norm. The relationship between "pow(a,b)" and &quo

[issue45154] Enumerate() function or class?

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: In pure python, generators are implemented as functions. In CPython, the only way to implement them is as a class. From a user's point of view, enumerate(), map(), zip(), and filter() are used like a functions (they doesn't have non-dund

[issue45139] Docs: add source directive for minor translation simplification

2021-09-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: New directives introduce complexity. They should be saved for pervasive and non-trivial problems. The motivation for this change is dubious (that a translator can't easily handle a simple fixed string pattern). The OP grants that this is a "o

[issue20499] Rounding errors with statistics.variance

2021-09-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: steven.daprano -> rhettinger ___ Python tracker <https://bugs.python.org/issue20499> ___ ___ Python-bugs-list mai

[issue20499] Rounding errors with statistics.variance

2021-09-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 3c30805b58421a1e2aa613052b6d45899f9b1b5d by Raymond Hettinger in branch '3.10': [3.10] bpo-20499: Rounding error in statistics.pvariance (GH-28230) (GH-28248) https://github.com/python/cpython/commit/3c30805b58421a1e2aa613052b6d45

[issue20499] Rounding errors with statistics.variance

2021-09-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +26669 pull_request: https://github.com/python/cpython/pull/28248 ___ Python tracker <https://bugs.python.org/issue20

[issue20499] Rounding errors with statistics.variance

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

[issue20499] Rounding errors with statistics.variance

2021-09-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 4a5cccb02bb2254634c0fbb2cbb14e2e7f45e2d5 by Raymond Hettinger in branch 'main': bpo-20499: Rounding error in statistics.pvariance (GH-28230) https://github.com/python/cpython/commit/4a5cccb02bb2254634c0fbb2cbb14e

[issue45139] Docs: More surrounding text into the "source" directive

2021-09-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- title: Simplify source links in documentation? -> Docs: More surrounding text into the "source" directive versions: +Python 3.11 ___ Python tracker <https://bugs.pytho

[issue45139] Simplify source links in documentation?

2021-09-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: ISTM that translating this fixed pattern is possibly one of the simplest things a translator will be asked to do, so there is very little payoff to making the change. For a person writing the docs, it is best to leave it as-is so that the wording and

[issue20499] Rounding errors with statistics.variance

2021-09-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger nosy_count: 4.0 -> 5.0 pull_requests: +26650 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28230 ___ Python tracker <https://bugs.python.org/i

[issue23864] doc: issubclass without registration only works for "one-trick pony" collections ABCs.

2021-09-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch nosy: +rhettinger nosy_count: 11.0 -> 12.0 pull_requests: +26644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28218 ___ Python tracker <https://bugs.p

<    1   2   3   4   5   6   7   8   9   10   >