Mark Dickinson added the comment:
+1 to the idea: `Decimal`, `float`, `complex` and `int` all understand the
underscores; there's no good reason for `Fraction` not to.
So yes please to the PR. There should be tests that check that only the
underscore rules allowed by `int` and the others
Mark Dickinson added the comment:
Nope, that's the wrong paper. It looks as though this is the right one, but
it's hidden behind a paywall: https://dl.acm.org/doi/abs/10.1145/42372.42381
--
___
Python tracker
<https://bugs.python.org/issue37
Mark Dickinson added the comment:
I think the NumPy implementation may be from here:
https://core.ac.uk/download/pdf/11007254.pdf
(though I'm struggling to find a clear citation in the NumPy source)
--
___
Python tracker
<https://bugs.python.
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue33213>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue44115>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
This is similar to #9025 (for randrange), and in principle the random.choices
case without explicit weights could be fixed similarly. But I'm not sure it's
worth it, for a couple of reasons:
- The problem only really affects "virtual" population
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue44080>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Closing here, since this isn't a bug. But I'd still like to understand better
what Stefan meant by "That's also what the code says."
--
resolution: -> not a bug
stage: -> resolved
status
Mark Dickinson added the comment:
> I have a vague memory that that's the way it *did* work once upon a time
Here we go: https://bugs.python.org/issue513866
And the corresponding commit, from September 2004:
https://github.com/python/cpython/commit/307fa78107c39ffda1eb4ad18201d25650354
Mark Dickinson added the comment:
> But the way I would have expected this to work is that a comparison of an
> integer to a float would first convert the integer to a float
I have a vague memory that that's the way it *did* work once upon a time, many
many decades ago. But an eq
Mark Dickinson added the comment:
[Alexander]
> Is there high enough demand for nanoseconds in datetime and time instances?
One need that we've encountered in real code is simply for compatibility. We
have Python code that interacts with a logging web service whose timestamps
incl
Mark Dickinson added the comment:
See https://github.com/numpy/numpy/issues/10645. I'll close here (this tracker
is for core Python, and NumPy isn't part of core Python).
--
nosy: +mark.dickinson
resolution: -> third party
stage: -> resolved
status: open -&g
Mark Dickinson added the comment:
Sorry, Sergey: I don't have the time, energy or inclination for an extended
discussion here, so I'll simply record my -1 for the proposed change and move
on. If you want to push this change through, the way forward would likely be to
find a core developer
Mark Dickinson added the comment:
> Is there any workaround?
Sorry, I can't answer that without knowing what it is you're trying to do -
that is, I don't know which part of the behaviour you want a workaround for.
But that's getting off topic for this tracker, which is for bug report
Change by Mark Dickinson :
--
resolution: -> not a bug
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue43940>
___
___
Python-bugs-
Mark Dickinson added the comment:
There's an implicit float-to-double conversion here (`fp.contents.value` is
represented as a Python float, which is backed by a C double). What you're
seeing is that converting the single-precision signaling NaN to double
precision loses the signaling bit
Change by Mark Dickinson :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
This is by design, and documented under the "sign" section here:
https://docs.python.org/3/library/string.html#format-specification-mini-language
The space before ".2f" is an instruction to leave space for a sign, "
Mark Dickinson added the comment:
For the record, here's the python-ideas thread:
https://mail.python.org/archives/list/python-id...@python.org/thread/AWNTQZ3HHAQ42O2ZHRA3U2US4HGKC2TF/
I'm no longer convinced that this is a good idea. It's the usual difference
between "Would it have
Mark Dickinson added the comment:
Opened https://github.com/numpy/numpy/issues/18833
--
___
Python tracker
<https://bugs.python.org/issue43475>
___
___
Pytho
Mark Dickinson added the comment:
Thanks, Raymond. I'll open something on the NumPy bug tracker, too, since they
may want to consider doing something similar for numpy.float64 and friends.
--
___
Python tracker
<https://bugs.python.org/issue43
Change by Mark Dickinson :
--
resolution: -> out of date
___
Python tracker
<https://bugs.python.org/issue27763>
___
___
Python-bugs-list mailing list
Un
Mark Dickinson added the comment:
Yes, it looks as though we do have tests of the form that Evelyn describes in
test_complex (which also seems like the right place for those tests).
Closing here. Thanks Sergey for the ping!
--
stage: test needed -> resolved
status: open ->
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Thank you for the quick fix!
--
___
Python tracker
<https://bugs.python.org/issue42248>
___
___
Python-bugs-list mailin
Mark Dickinson added the comment:
Would the code be cleaner if it used PyTuple_Pack?
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43
Mark Dickinson added the comment:
Duplicate of #28197?
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43836>
___
___
Python-bug
Mark Dickinson added the comment:
FWIW, I think we should close this; the same comments as in issue 26256 apply.
See msg259408 onwards in that discussion.
--
___
Python tracker
<https://bugs.python.org/issue3
Mark Dickinson added the comment:
> we have implemented a faster algorithm for divmod for big numbers using
> Mark's fast_div.py in PyPy
Urk! I hope your implementation included a healthy dose of validation, testing
and cleanup. :-) (I have no doubts that it did.)
I'd consider fast_
Mark Dickinson added the comment:
FWIW, if you're specifically interested in complex square roots rather than
powers in general, I'd recommend using `cmath.sqrt(value)` rather than
`value**0.5` - there are fewer intermediate steps involved in computing
`cmath.sqrt`, and the returned value
Mark Dickinson added the comment:
Thanks, Sergey! Agreed that this can be closed.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
> Why not have hash() return the id() like we do for instances of object?
I think that's fine, and IIUC that's what Cong Ma was proposing. It seems like
the least invasive potential fix.
In principle I find the idea of making NaN a singleton rat
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43753>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Here's a cut-down example, at the prompt:
Python 3.9.2 (default, Mar 31 2021, 05:47:22)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>&g
Mark Dickinson added the comment:
I'm running into this, too, on Python 3.9.2; in my case it's causing
segmentation faults in a wxPython-based application.
Those segfaults aren't the fault of the reference cycle, of course; they're a
result of wxPython being finicky about object cleanup
Change by Mark Dickinson :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue43682>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Seems like a duplicate of #20309.
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43682>
___
___
Change by Mark Dickinson :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
title: safgf -> spam
type: performance ->
___
Python tracker
<https://bugs.pyt
Mark Dickinson added the comment:
> Seems so, for a static typing. But Python is a dynamically typed
> language, isn't?
I think we're talking at cross purposes. Static and dynamic typing have nothing
to do with this.
What do you think the result of `1.0 + Decimal(1)` should be, an
Mark Dickinson added the comment:
> I assume, the reason is: there is no lossless conversion to float's (and vice
> verse).
No, I don't think that's the reason (and in fact we _do_ have lossless
conversion of floats to Decimal instances). IMO, the reasons are:
- it's not obviou
Mark Dickinson added the comment:
Hi Victor,
I just noticed the change to dtoa.c in GH-24821. Please could you explain what
the benefit of this change was?
In general, we need to be very conservative with changes to dtoa.c: it's a
complex, fragile, performance-critical piece of code
Change by Mark Dickinson :
--
components: -Regular Expressions
___
Python tracker
<https://bugs.python.org/issue43580>
___
___
Python-bugs-list mailin
Mark Dickinson added the comment:
It's behaving as designed and documented; see the docs here:
https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range
(and particularly note 3).
In your first example, the first `-1` in `x[1:-1:-1]` is interpreted relative
to the end
Mark Dickinson added the comment:
Carl: can you say more about the problem that motivated this issue?
--
___
Python tracker
<https://bugs.python.org/issue43
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue42161>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue40521>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
You have a local file named `turtle.py`, which is conflicting with the standard
library `turtle` module. Rename your local file to something else, then you'll
be able to import the standard library `turtle` module.
--
nosy: +mark.dickinson
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue39511>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Related: #6632
--
___
Python tracker
<https://bugs.python.org/issue43520>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Seems worth noting that Unicode fractions like ⅔ produce a FRACTION SLASH
character when normalized:
>>> unicodedata.normalize('NFKC', '⅔')
'2⁄3'
>>> list(map(unicodedata.name, unicodedata.normalize('NFKC', '⅔')))
['DIGIT TWO', 'FRACTION SL
Mark Dickinson added the comment:
There's a bigger issue here about what characters should be accepted in numeric
literals. The Unicode minus sign (U+2212) "−" is also not currently accepted
for Fractions or any other built-in numeric type.
> but there are other si
Change by Mark Dickinson :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> exec docs should note that the no argument form in a local
scope is really the two argument form
___
Python tra
Mark Dickinson added the comment:
I think this is essentially a duplicate of #24800. (Short version, the
behaviour is by design, and documented, but there may be scope for clarifying
or improving the documentation.)
--
nosy: +mark.dickinson
Mark Dickinson added the comment:
Re-opening; I believe this issue is still valid.
Here's output on a debug build on current master (commit
7591d9455eb37525c832da3d65e1a7b3e6dbf613) on my machine:
lovelace:cpython mdickinson$ ./python.exe
Python 3.10.0a6+ (remotes/upstream/master:7591d9455e
Mark Dickinson added the comment:
@Victor: How does the fix for #37193 solve this issue? I think I'm missing
something.
--
___
Python tracker
<https://bugs.python.org/issue37
Mark Dickinson added the comment:
@Cong Ma: Yes, I'm not worried about performance for the change you're
proposing (though as you say, we should benchmark anyway). The performance
thoughts were motivated by the idea of making NaN a singleton: adding a check
to PyFloat_FromDouble would mean
Mark Dickinson added the comment:
> signalling NaNs are quietly silenced on my machine
I just tested this assertion, and it appears that I was lying: this doesn't
seem to be true. I'm almost *sure* it used to be true, and I'm not sure what
changed, and when. (FWIW: Python 3.9.2 f
Mark Dickinson added the comment:
> We could make this problem go away by making NaN a singleton.
That could work, though we'd annoy anyone who cared about preserving NaN
payloads and signs in Python. I don't know if such people exist. Currently the
sign is accessible through things l
Mark Dickinson added the comment:
> I also wonder if there's security implication for servers that process
> user-submitted input
Yes, the "malicious actor" scenario is another one to consider. But unlike the
string hashing attack, I'm not seeing a realistic way for the nan
Mark Dickinson added the comment:
On third thoughts, of course it *would* help, because the Counter is keeping
references to the realised NaN values. I think I'll go away now and come back
when my brain is working.
--
___
Python tracker
<ht
Mark Dickinson added the comment:
Hmm. On second thoughts, the proposed solution wouldn't actually *help* with
the situation I gave: the elements (lazily) realised from the NumPy array are
highly likely to all end up with the same address in RAM. :-(
>>> x = np.full(10, np.nan)
Mark Dickinson added the comment:
Sigh. When I'm undisputed ruler of the multiverse, I'm going to make "NaN ==
NaN" return True, IEEE 754 be damned. NaN != NaN is fine(ish) at the level of
numerics; the problems start when the consequences of that choice leak into the
o
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43475>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
> At most I think this issue is a duplicate of bpo-24800
Agreed; closing here.
--
nosy: +mark.dickinson
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> exec docs should note that the no argument
Mark Dickinson added the comment:
Thanks; I missed that one. I'll update the state of this one to mark it as a
duplicate of #37788.
--
___
Python tracker
<https://bugs.python.org/issue43
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue37788>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
resolution: -> duplicate
superseder: -> fix for bpo-36402 (threading._shutdown() race condition) causes
reference leak
___
Python tracker
<https://bugs.python.org/i
Mark Dickinson added the comment:
> There is one exception I've found: stdlib's statistics module uses
> Fraction's in the _sum() helper, exactly in a paradigm "sum a lot
> of values".
That's an interesting example: it does indeed satisfy the "sum o
Mark Dickinson added the comment:
Just a note that #43422 would make this moot.
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43
Mark Dickinson added the comment:
Personally, I'd prefer to keep the code simplicity, and the speed for small
inputs here. Python's needs aren't the same as SymPy's needs or SAGE's needs,
and not all of the fractions.Fraction use-cases involve summing lots of values
with incompatible
Mark Dickinson added the comment:
+1 for reverting these before 3.10. See also @mattip's comments on #41324, and
#43060.
--
___
Python tracker
<https://bugs.python.org/issue43
Mark Dickinson added the comment:
Sounds fine to me. If I'm understanding right, what we have in master right now
is somewhere between libmpdec 2.5.0 and libmpdec 2.5.1; is that right? If so,
it definitely makes sense to update to 2.5.1
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43420>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
> Since Timer thread is never joined, should not it be a daemon?
Possibly, but I think that's a new question/issue. :-) And presumably there's
no reason you can't make your Timer threads into daemon threads if you have a
n
Mark Dickinson added the comment:
One more thing: I'm assuming that everything in sight is single-threaded? With
more than one Python thread (even if that thread is auxiliary to anything
you're doing - e.g., if you're working at an IPython prompt, there will likely
be at least a couple
Mark Dickinson added the comment:
Have you tried doing a "gc.get_referrers" on your weakref, to verify that there
aren't any references that you don't expect to be there?
Another diagnostic would be to run with cyclic garbage collection disabled (via
gc.disable). If you're seeing
Mark Dickinson added the comment:
If I understand correctly, the reported bug is that you're seeing a weakref
callback being executed after the weakref.ref instance it's attached to is
deleted. Is that correct?
Do you have a minimal example we can use to reproduce the effect? Without
Mark Dickinson added the comment:
I'd imagine "PyComplex_FromString" would be of limited utility in parsing
complex data produced by something other than Python, because of Python's
quirks with "j" rather than "i". But I guess you're talking about a case where
Mark Dickinson added the comment:
I'm not sure that this counts as a bug.
Each non-daemon thread adds a lock to the threading._shutdown_locks set:
https://github.com/python/cpython/blob/8b795ab5541d8a4e69be4137dfdc207714270b77/Lib/threading.py#L933-L935.
That lock is removed when the thread
Mark Dickinson added the comment:
Hmm. Somehow the trailing dot became part of the second URL.
Trying again: https://github.com/tensorflow/tensorflow/issues/44485
--
___
Python tracker
<https://bugs.python.org/issue43
Mark Dickinson added the comment:
Wrong tracker. Try https://github.com/tensorflow/tensorflow. (See in particular
https://github.com/tensorflow/tensorflow/issues/44485.)
--
nosy: +mark.dickinson
resolution: -> third party
stage: -> resolved
status: open -&g
Mark Dickinson added the comment:
Closing here; the built-in formatting should be sufficient, as discussed.
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
Sure, but that has nothing to do with string representations or formatting, so
I don't see how it's relevant for this issue: the rounding happens when you
call `normalize`.
--
___
Python tracker
<ht
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43060>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue42914>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue43263>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
@twoone3: Shouldn't you be calling PyGILState_Ensure() before calling into
Python from the C++ code?
In any case, I'm removing myself from the nosy list on this issue, because I
don't have access to Windows to try to reproduce
Mark Dickinson added the comment:
Postscript: the "MethodType" that appears in the previous comment can be
imported from the types module: "from types import MethodType".
--
___
Python tracker
<https://bug
Mark Dickinson added the comment:
The key difference between the func_del function and the instance C() is that
func_del is a (non-data) descriptor in addition to being callable, while the
instance C() is not. That makes func_del usable as a method.
If you define C as follows, you'll see
Mark Dickinson added the comment:
This is by design: the choice of -6 is not arbitrary, but follows the standard
that the Decimal class is based on. Quoting from
http://speleotrove.com/decimal/daconvs.html#reftostr:
> If the exponent is less than or equal to zero and the adjusted expon
Mark Dickinson added the comment:
[twoone3]
> Have you been studying this problem?
Not personally, no. Sorry, but I'm afraid this really isn't an actionable bug
report as it stands: we still don't have an effective way to reproduce, and
it's far from clear that this is actually a
Mark Dickinson added the comment:
Closing as third-party. But for the record, I suspect the problem here is
arising from confusion between standard library modules and third-party
packages: the multiprocessing package is not a 3rd party package like NumPy
(for example): instead, it's part
Change by Mark Dickinson :
--
resolution: -> works for me
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue43263>
___
___
Pyth
Mark Dickinson added the comment:
Sorry, but as Ronald says there's not nearly enough information here. Some
questions:
- What do you mean by "embedded Python"?
- What is "the exe" that you refer to in your second mesasge? Is that
python.exe? Is that an executable yo
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue42686>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue18163>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Dickinson :
--
nosy: -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue2142>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Closing; the documentation was updated recently. See #39096 for details.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
The documentation did get updates: see #39096 for details. Closing here.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
401 - 500 of 6360 matches
Mail list logo