Change by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43613>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Raymond Hettinger :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue43535>
___
___
Python-bugs-
Change by Raymond Hettinger :
--
nosy: +tim.peters
___
Python tracker
<https://bugs.python.org/issue43602>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Raymond Hettinger :
--
Removed message: https://bugs.python.org/msg389373
___
Python tracker
<https://bugs.python.org/issue43602>
___
___
Python-bug
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
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
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
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
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
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
Change by Raymond Hettinger :
Removed file: https://bugs.python.org/file49898/Mobile_Signup.vcf
___
Python tracker
<https://bugs.python.org/issue26680>
___
___
Python-bug
Change by Raymond Hettinger :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Change by Raymond Hettinger :
--
pull_requests: +23703
pull_request: https://github.com/python/cpython/pull/24944
___
Python tracker
<https://bugs.python.org/issue40
Change by Raymond Hettinger :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue43566>
___
___
Python-bugs-
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 &
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
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
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
Raymond Hettinger added the comment:
+1 for this idea. I don't see any downside.
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/is
Change by Raymond Hettinger :
--
assignee: -> docs@python
components: +Documentation -Windows
nosy: +docs@python
type: performance -> behavior
___
Python tracker
<https://bugs.python.org/i
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
Change by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43521>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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)
Raymond Hettinger added the comment:
Thanks for the PR :-)
--
___
Python tracker
<https://bugs.python.org/issue41361>
___
___
Python-bugs-list mailing list
Unsub
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
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
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
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
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
Change by Raymond Hettinger :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
Raymond Hettinger added the comment:
Are on an Intel processor or Apple Silicon?
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43
Change by Raymond Hettinger :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10
___
Python tracker
<https://bugs.python.or
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
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
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
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
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
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
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
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
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
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
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
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
Change by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
___
Python tracker
<https://bugs.python.org/issue43427>
___
___
Python-bugs-list mai
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.
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
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
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
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
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
Raymond Hettinger added the comment:
+1 fron me.
--
___
Python tracker
<https://bugs.python.org/issue43422>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Raymond Hettinger :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue43413>
___
___
Python-bugs-list mailing list
Unsub
Change by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue30469>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Change by Raymond Hettinger :
--
assignee: rhettinger ->
___
Python tracker
<https://bugs.python.org/issue43400>
___
___
Python-bugs-list mailing list
Un
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
Change by Raymond Hettinger :
--
nosy: +lukasz.langa
___
Python tracker
<https://bugs.python.org/issue43399>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Raymond Hettinger :
--
assignee: docs@python -> rhettinger
___
Python tracker
<https://bugs.python.org/issue43400>
___
___
Python-bugs-list mai
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
Raymond Hettinger added the comment:
+1 for back porting, but check with the RM first.
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43
Raymond Hettinger added the comment:
+1 for the OP's suggestion.
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43400>
___
___
Pytho
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
Change by Raymond Hettinger :
--
nosy: +Daniel Moisset, brandtbucher, gvanrossum, willingc
___
Python tracker
<https://bugs.python.org/issue43378>
___
___
Pytho
Raymond Hettinger added the comment:
Should __match_args__ be added to Objects/structseq.c ?
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue42
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
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
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
Change by Raymond Hettinger :
--
nosy: +vinay.sajip
___
Python tracker
<https://bugs.python.org/issue40469>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
Change by Raymond Hettinger :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43341>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Change by Raymond Hettinger :
--
nosy: +pitrou
___
Python tracker
<https://bugs.python.org/issue43293>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Raymond Hettinger added the comment:
Happy new year to you as well :-)
--
___
Python tracker
<https://bugs.python.org/issue43287>
___
___
Python-bugs-list mailin
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
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
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
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
Raymond Hettinger added the comment:
Why is this needed? Already, instantiation is blocked.
--
nosy: +gvanrossum, rhettinger
___
Python tracker
<https://bugs.python.org/issue43
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
Change by Raymond Hettinger :
--
Removed message: https://bugs.python.org/msg386847
___
Python tracker
<https://bugs.python.org/issue43198>
___
___
Python-bug
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
Change by Raymond Hettinger :
--
assignee: -> rhettinger
___
Python tracker
<https://bugs.python.org/issue43198>
___
___
Python-bugs-list mailing list
Un
901 - 1000 of 9609 matches
Mail list logo