Mark Shannon added the comment:
New changeset cca43b7d64f47ea921d0f7a347ae1a839c5463c3 by Dennis Sweeney in
branch 'main':
bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)
https://github.com/python/cpython/commit/cca43b7d64f47ea921d0f7a347ae1a
Mark Shannon added the comment:
I think that adding macros makes readability worse.
The macro is only more readable if you already know what it does.
If you don't, then you need to look up the macro, and understand the cast in
the macro (which is harder than understanding the original
Mark Shannon added the comment:
The problem in the example you give is the need for the cast in the first
place. If `func` were a `PyCFunctionObject *` instead of a `PyObject *`, then
there would be no cast.
Making the casts explicit serves as a reminder that a type check is needed
Mark Shannon added the comment:
New changeset a00518d9ad9a8f408a9699191019d75dd8406c32 by Irit Katriel in
branch 'main':
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD
(GH-32115)
https://github.com/python/cpython/commit/a00518d9ad9a8f408a9699191019d7
Mark Shannon added the comment:
New changeset 74b95d86e0f14603f878c4df3133bc8a93f8f80a by Mark Shannon in
branch 'main':
bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)
https://github.com/python/cpython/commit/74b95d86e0f14603f878c4df3133bc
Mark Dong added the comment:
Hi,
I want to follow up on this:
On Linux (Ubuntu 20.04.4 LTS), the module also loads everything it finds in the
registries (a.k.a, entries in the "knownfiles" variable) in "strict" mode, even
though some of them aren't registered in
Mark Shannon added the comment:
New changeset a0ea7a116ce52a178c02d42b684089758bd7f355 by Dennis Sweeney in
branch 'main':
bpo-47009: Streamline list.append for the common case (GH-31864)
https://github.com/python/cpython/commit/a0ea7a116ce52a178c02d42b684089758bd7f355
-
Mark Shannon added the comment:
New changeset bd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb by Brandt Bucher in
branch 'main':
bpo-46841: Avoid unnecessary allocations in code object comparisons (GH-3)
https://github.com/python/cpython/commit/bd2e47c8830d1b2869f2b4345945a5
Mark Shannon added the comment:
New changeset ae9de82e321581e1906c6ef2a7ad83ab30ae3325 by Brandt Bucher in
branch 'main':
bpo-46841: Use a `bytes` object for `_co_code_adaptive` (GH-32205)
https://github.com/python/cpython/commit/ae9de82e321581e1906c6ef2a7ad83
Mark Shannon added the comment:
New changeset 04e07c258f4f2ac85e25355242a113f98a706f04 by Irit Katriel in
branch 'main':
bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)
https://github.com/python/cpython/commit/04e07c258f4f2ac85e25355242a113
Mark Shannon added the comment:
New changeset 997ba5d126f5040d5b7536f73bc89049e9f9421d by Irit Katriel in
branch 'main':
bpo-47172: Compiler enhancements (GH-32200)
https://github.com/python/cpython/commit/997ba5d126f5040d5b7536f73bc89049e9f9421d
--
nosy: +Ma
Change by Mark Shannon :
--
pull_requests: +30363
pull_request: https://github.com/python/cpython/pull/32301
___
Python tracker
<https://bugs.python.org/issue44
New submission from Mark Shannon :
We need to provide an API to create, swap and free frame stacks for greenlets.
Since this is primarily for greenlets (and any other stackful coroutines
libraries that want to use it) it will be "unstable".
In this case, by "unstable" I
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +30366
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32303
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
New changeset 8a349eb30b54bab9a7146fc10e3379c3cacaa19e by Mark Shannon in
branch 'main':
Revert "bpo-44800: Document internal frame naming conventions (GH-32281)"
(#32301)
https://github.com/python/cpython/commit/8a349eb30b54bab9a714
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +30367
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/32304
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
New changeset 6c6e0408a663c1f53dad403f54a18d444da39cb7 by Dennis Sweeney in
branch 'main':
bpo-47009: Let PRECALL_NO_KW_LIST_APPEND do its own POP_TOP (GH-32239)
https://github.com/python/cpython/commit/6c6e0408a663c1f53dad403f54a18d
Mark Dickinson added the comment:
FWIW, I do consider this a bug, albeit a minor one. I may find time to fix it
at some point (but it's fine to leave it closed until that time comes).
--
___
Python tracker
<https://bugs.python.org/is
New submission from Mark Shannon :
The 3 regular expression benchmarks in the pyperformance suite, regex_v8,
regex_effbot and regex_dna show slowdowns between 3% and 10%.
Looking at the stats, nothing seems wrong with specialization or the memory
optimizations.
Which strongly suggests a
Mark Dickinson added the comment:
> but it's messy and potentially tricky to get the actual first and last values
> of the range
Doesn't simple indexing already provide what you need here?
>>> range(1, 5, 2)[0] # first element of range
1
>>> range(1, 5,
Change by Mark Shannon :
--
pull_requests: +30439
pull_request: https://github.com/python/cpython/pull/32413
___
Python tracker
<https://bugs.python.org/issue40
Mark Shannon added the comment:
Don't you need to know if a "call" event is a call or the resumption of a
generator?
--
___
Python tracker
<https://bugs.pyt
Mark Dickinson added the comment:
[Raymond]
> Given that & | and ^ are closed under bools [...]
So maybe the right fix is to change that fact? I'm not sure what the value of
having True & True return True rather than 1 is, beyond misleading people into
thinking that bitwise
Mark Dickinson added the comment:
> Because bool is embedded in int, it's okay to return a bool value *that
> compares equal to the int from the corresponding int operation*.
Agreed that it's okay, but I'd like to understand why it's considered
*desirable*. W
Mark Dickinson added the comment:
> shouldn't numerics, datetime objects, and tuples be non-deterministically
> hashed as well? [...]
Making the numeric hash non-predictable while maintaining its current
properties would be difficult.
But fortunately, I don't think it
Mark Dickinson added the comment:
> Should be significantly faster. If not, the new "-1" implementation should
> be changed ;-)
I wouldn't have bet on this, before seeing Raymond's benchmark results. Writing
a fast path for invmod for C-size integers is still on m
Mark Dickinson added the comment:
> That's a major difference between exponents of bit lengths 61
> ((P-2).bit_length()) and 1 ((1).bit_length()).
Right, but that's stacked up against the cost of the extended Euclidean
algorithm for computing the inverse. The extended gcd f
Mark Dickinson added the comment:
> Indeed, I bet it would pay in `long_pow()` to add another test, under the `if
> (Py_SIZE(b) < 0)` branch, to skip the exponentiation part entirely when b is
> -1.
Agreed.
--
___
Python tra
Mark Dickinson added the comment:
> Why so?
Python's hash needs to obey the invariant that `hash(x) == hash(y)` for any two
hashable objects with `x == y`. That makes life particularly hard for numeric
types, because there are a number of *different* numeric types where equality
Mark Dickinson added the comment:
> This issue if for optimization only. It does not expand the math module API.
I think it does, though. The PR adds something to the math module that's
tested, that needs to be maintained for other modules to work, and that's
imported for u
Mark Dickinson added the comment:
> While I doubt this, he may even argue that it's working correctly already ;-)
Yes, I'd argue exactly that. There's nothing ill-defined about working modulo
+/-1. Z/1Z is a perfectly-well-defined ring. What's the moti
Mark Dickinson added the comment:
> Z/1Z is a perfectly-well-defined ring.
More to the point, it's a perfectly well-defined ring in which every element is
invertible. That's why the Euler phi function has phi(1) = 1 (rather than
phi(1) = 0)
Mark Dickinson added the comment:
> I guess I'm just not used to 0 being a multiplicative identity.
Yes, there's a whole generation of mathematicians who believe (wrongly) that "0
!= 1" is one of the ring axioms. But it turns out that excluding the zero rin
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue37905>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Sapiro :
This is really due to an nntp server bug, but here's the scenerio.
A connection is opened to the server.
An article is posted via the connection's post() method.
The server responds to the article data with
240 Article posted
but due to the serv
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue37938>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
They're not part of the C standard and they're not provided by all C libraries;
we'd have to code our own and add thorough tests for the implementations (as we
have for lgamma, gamma, erf, and other functions that may or may not exist in
th
Mark Dickinson added the comment:
I'd also say that SciPy does this much better than the Python math library
could ever hope to (without that math library effectively becoming a copy of
scipy.special). It probably wouldn't be long before a user of the new Bessel
functions also wan
Change by Mark Dickinson :
--
nosy: +tim.peters
___
Python tracker
<https://bugs.python.org/issue37946>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Dickinson added the comment:
Tim, Raymond: thoughts? I'm inclined to close this as rejected.
--
___
Python tracker
<https://bugs.python.org/is
Mark Dickinson added the comment:
> 1 the next code SHOULD produce an error message. Think that it's followed
> by a few dozens of code lines:
> from turtle import *
> fd; rt(90)
There's no reasonable mechanism in current Python by which this could produce
an error mess
Mark Dickinson added the comment:
Updated title, type and Python version (this would be a new feature, so would
be targeted at Python 3.9).
--
components: +Library (Lib)
title: The turtle -> Add a turtle module function to draw a circle centered at
the turtle
type: -> enhan
Change by Mark Dickinson :
--
nosy: +glingl, willingc -mark.dickinson
___
Python tracker
<https://bugs.python.org/issue37968>
___
___
Python-bugs-list mailin
Mark Dickinson added the comment:
Unhelpful indeed. +1 to updating those docstrings to match the details at
docs.python.org.
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue37
Mark Dickinson added the comment:
@nanjekyejoannah I'm not seeing how that issue is related to this one (except
that they're both about docstrings). Can you elaborate?
--
___
Python tracker
<https://bugs.python.o
Mark Dickinson added the comment:
Closely related: #37427. I'm not sure why that issue was closed. My naive
expectation would be that in most cases where an API specifies a flag, an
arbitrary Python object can be used for that flag (and is then interpreted in
boolean context). That&
Mark Dickinson added the comment:
See also #37980. I'd support a change to have the `reversed` argument to `sort`
and `sorted` be automatically interpreted in boolean context.
--
___
Python tracker
<https://bugs.python.org/is
Mark Dickinson added the comment:
Yes, I think there's a lot of history here that obscures the picture.
We have mechanisms in Python to allow 3rd party objects to be interpreted as
floats (via __float__) or as integers (via __index__).
So np.int64 (for example) doesn't subcla
Mark Dickinson added the comment:
Since this particular issue is about "sort", I'm adding Tim and Raymond to the
nosy list.
--
nosy: +rhettinger, tim.peters
___
Python tracker
<https://bugs.pyt
Mark Dickinson added the comment:
Victor
> The purpose of the DeprecationWarning is to give time to numpy developers to
> update the bool_() type, before it becomes an error.
No, that's not what's happening: currently, np.bool_ *does* support __index__.
In the future, it
Mark Dickinson added the comment:
Urk! Having `10 == id == 10.1` should imply `10 == 10.1`, by transitivity.
Are interpreter.InterpreterID objects hashable? If so, we've got a violation of
the rule that `x == y` implies `hash(x) == hash(y)`.
--
nosy: +mark.dick
Mark Dickinson added the comment:
There are known Cython-related issues with the latest NumPy *release* and
Python 3.8, due to a signature change in PyCode_New. But those issues are
already fixed in NumPy master. `pip install numpy` fails for me in a Python
3.8b4 venv, but `pip install git
Mark Dickinson added the comment:
I forgot to include the NumPy issue link:
https://github.com/numpy/numpy/issues/14403 (and other similar issues).
The pip error output you posted looks like the same issue to me.
--
___
Python tracker
<ht
New submission from Mark Dickinson :
Suppose I have a class that looks like this:
class A:
def cleanup(self):
print("Doing essential cleanup")
and on an instance `a = A()`, I do: `atexit.register(a.cleanup)`.
Then it's not obvious from the docume
Change by Mark Dickinson :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
This seems like the correct thing to do.
Since the AST changes from version to version, I don't see how these files
could reasonably be part of the limited API.
--
nosy: +Mark.Shannon
___
Python tracker
&
Mark Shannon added the comment:
New changeset 421a72af4deaec96a49a79951b9c2546a2faa13d by Mark Shannon (Zackery
Spytz) in branch 'master':
bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API (#14634)
https://github.com/python/cpyt
Change by Mark Shannon :
--
stage: patch review -> resolved
___
Python tracker
<https://bugs.python.org/issue21120>
___
___
Python-bugs-list mailing list
Un
Change by Mark Shannon :
--
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue21120>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Mark Shannon :
Consider a flow graph of four nodes, A, B, C, D
where the A, B, C are "next" successors of each other (in order) and C branches
to B and B branches to D. Note that there is no "next" link to the D block.
The correct order is A, B, C, D bu
Change by Mark Shannon :
--
nosy: +pablogsal
___
Python tracker
<https://bugs.python.org/issue38135>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Mark Shannon :
--
keywords: +patch
pull_requests: +15664
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16042
___
Python tracker
<https://bugs.python.org/issu
Mark Shannon added the comment:
I expect to fix this is as part of the general improvements I am making to the
bytecode, interpreter and compiler.
So it should be fixed for 3.9 but not for 3.8
--
___
Python tracker
<https://bugs.python.
Mark Dickinson added the comment:
> Maybe issue38106 related.
That looks plausible, but unfortunately I'm still able to reproduce the hang
with your PR (commit 9b135c02aa1edab4c99c915c43cd62d988f1f9c1, macOS 10.14.6).
--
___
Python
Change by Mark Dickinson :
--
title: Deadlock in thread.join on Python 2.7/Mac OS X 10.9, 10.10 -> Deadlock
in thread.join on Python 2.7/macOS
___
Python tracker
<https://bugs.python.org/issu
Mark Dickinson added the comment:
This isn't a bug: super is behaving as designed and as intended here, and
indeed with a diamond inheritance structure you'll see super calling "across"
from one class to its sibling. That's part of how it works.
There's lots o
Change by Mark Dickinson :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
FWIW, I've confirmed again that the exact same script on the same machine seems
fine under Python 3.x. Given the imminent demise of Python 2, perhaps this
issue is just destined to be an unsolved historical o
Mark Dickinson added the comment:
Right, `max` can only give meaningful results when presented with elements that
belong to a totally-ordered collection. Unfortunately, floats-including-nan is
not such a collection (though floats-excluding-nan *is*, provided we ignore
wrinkles with positive
Change by Mark Dickinson :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Mark Dickinson added the comment:
The proposal sounds reasonable to me.
> should a similar change be made for `math.pow` for consistency's sake?
I'd leave math.pow alone here.
--
___
Python tracker
<https://bugs.pytho
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue38308>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Mark Amery :
There seems to be at least some demand for the ability to have the key being
accessed be passed to the factory function of a defaultdict. See e.g.
https://stackoverflow.com/q/2912231/1709587 (13k views) or previous enhancement
suggestion https
Mark Amery added the comment:
I'm aware of __missing__. However, I don't think its existence is by itself a
knockdown argument against doing this. __missing__ also fulfils the need
satisfied by defaultdict, yet Python still has both - and the latter is almost
always more conveni
Mark Dickinson added the comment:
This is a common gotcha. Take a look at:
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
--
nosy: +mark.dickinson
resolution: -> not a bug
stage: -> resolved
status: open -&g
Mark Shannon added the comment:
"What's new in Python 3.8" says that this change speeds up the LOAD_GLOBAL
opcode by 40%.
That seems meaningless as a program cannot have LOAD_GLOBAL in isolation so any
test would have other bytecodes as well.
What's the evidence for
Mark Shannon added the comment:
Given that
def foo(): int; str; bytes; float; int; str; bytes; float
can be trivially be rewritten as
def foo(): pass
I think that benchmark is meaningless.
I really don't think we should be making claims like "40% speedup" for such
contrive
Mark Dickinson added the comment:
Looks like a duplicate of #34108
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue36075>
___
___
Pytho
Mark Dickinson added the comment:
Closing as duplicate.
@sabakauser: if you update to a recent Python 3.7 (anything more recent than
3.7.1 should be enough), you should find that this is fixed.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
s
Mark Dickinson added the comment:
> In [20]: harmonic_mean([math.nan, 0])
>
> Out[20]: 0
That one seems excusable, for the same sort of reasons that IEEE 754 specifies
that hypot(nan, inf) is inf rather than nan. Similarly, sumSquare a
Mark Dickinson added the comment:
> Rewriting all this code just because we have Py_ISDIGIT() is a code churn.
I'm inclined to agree: the current code works and is efficient; there's no
strong reason to change it.
--
___
Python tr
Mark Dickinson added the comment:
I agree with Serhiy. Any other unrecognised character would raise an error. The
null character should do the same.
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue35
Mark Dickinson added the comment:
Thank you for the suggestion. I don't think this fits that well with the view
of the math module as a set of basic building blocks: this is quite a
specialist function that wouldn't come up often in applications.
--
nosy: +mark
Mark Dickinson added the comment:
Sorry, but I'm rejecting this: I don't think this is likely to have value to a
range of users, and it's not a basic building block - as such, it doesn't
really fit with the current design and intended usage of the math module.
You might
Mark Borgerding added the comment:
@pitrou I don't necessarily agree that "current behavior can't be changed".
One major selling point of exceptions is that they cannot be accidentally
ignored. The exception is how the current threading.Thread ignores them.
You are c
Mark Borgerding added the comment:
I'm not trying to disrespect anyone: not users nor certainly Python developers.
I have loved Python since I learned it in 2001. I was merely trying to
respond to what seemed like an automatic rejection of changing legacy behavior.
I certainly
Mark Dickinson added the comment:
> I have doubts about adding a C code which is never even executed.
My reading of the PR is that it *would* be executed: the math module first
looks for the __floor__ special method, then falls back to using the libm floor
if that doesn't exi
Mark Dickinson added the comment:
> If float.__ceil__ will be executed it will add significant overhead for
> creating and executing the method object.
Yes, I'd definitely like to see timings; I think Victor already asked for those
Mark Dickinson added the comment:
> Maybe we should hold-off on adding negative number support unless a
> compelling use case arises.
+100. It makes little sense mathematically, and I'm sceptical that such use
cases exist i
Change by Mark Dickinson :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue38657>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mark Shannon added the comment:
I'm strongly opposed to this change.
PEP 523 does not specify what the semantics of changing the interpreter frame
evaluator actually is:
Is the VM obliged to call the new interpreter?
What happens if the custom evaluator leaves the VM in a inconsistent
Mark Shannon added the comment:
Fabio,
OOI what are you trying achieve by changing the frame evaluator?
--
___
Python tracker
<https://bugs.python.org/issue38
Mark Dickinson added the comment:
What Serhiy said. round is behaving as intended and as designed here.
Note: you can also see the actual value of a float object easily by using
Decimal:
>>> from decimal import Decimal
>>> Decimal
Mark Dickinson added the comment:
[Steven]
py> '%.17f' % 0.95
'0.94996'
That's tricky to use correctly: it's not a priori clear how many digits after
the point are needed to give you a faithful representation (the "17" in "%.
Mark Shannon added the comment:
Victor,
I don't think this is a regression.
`PyThreadState` is an internal opaque data structure, which means we are free
to change it.
That the `eval_frame` is hard to access is a feature not a bug, as it
discourages misuse and enables us to remove it e
Mark Dickinson added the comment:
[Terry]
> A correct failure message, correct both as English and Python, should be
> something like 'bool(x) is not True'. I see 'x is not true' as an informal
> English equivalent of the full claim.
I'm not clea
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:
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
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:
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
&
3001 - 3100 of 12223 matches
Mail list logo