Stefan Krah added the comment:
raw_bytes() is also possible of course. I assume it would do nothing and just
dump the memory.
Or tobytes('F') AND tobytes('raw').
--
___
Python tracker
<https://bug
Stefan Krah added the comment:
CC Antoine and Nick.
I think we can do it, but we'd need cast(shape=[2,3], order='F')
to allow casting back.
The only practical objections are feature creep. To preserve
symmetry with tobytes(), we'd need to add tobytes('F') (and
t
Change by Stefan Krah :
--
keywords: +patch, patch, patch
pull_requests: +11620, 11621, 11622
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Stefan Krah :
--
keywords: +patch, patch
pull_requests: +11620, 11621
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Stefan Krah :
--
keywords: +patch
pull_requests: +11620
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Stefan Krah added the comment:
Yes, following NumPy looks like the sanest option for tobytes(), so I
went ahead and implemented that signature.
memory.raw() is of course complicated by the fact that things like
m[::-1] move buf.ptr to the end of the buffer.
So we'd need to restri
Stefan Krah added the comment:
It seems reasonable to support f-contiguous for cast() and tobytes().
For tobytes() it's implemented in the issue that Antoine linked to.
General support for strides in cast(), i.e. a zero-copy view for
non-contiguous arrays does not seem possible be
Stefan Krah added the comment:
New changeset 00e9c55d27aff3e445ab4c8629cf4d59f46ff945 by Stefan Krah (Cheryl
Sabella) in branch 'master':
bpo-26256: Document algorithm speed for the Decimal module. (#4808)
https://github.com/python/cpython/commit/00e9c55d27aff3e445ab4c8629cf4d
Stefan Krah added the comment:
New changeset a2f4c4023314f69333d2e8cee68e316619f3d68e by Stefan Krah (Miss
Islington (bot)) in branch '3.7':
bpo-26256: Document algorithm speed for the Decimal module. (GH-4808) (#11736)
https://github.com/python/cpyt
Change by Stefan Krah :
--
assignee: docs@python -> skrah
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Stefan Krah added the comment:
New changeset d08ea70464cb8a1f86134dcb4a5c2eac1a02bf1a by Stefan Krah in branch
'master':
bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730)
https://github.com/python/cpython/commit/
Stefan Krah added the comment:
Eryk Sun:
Yes, the behavior is technically not guaranteed. I'm not sure about
memoryview(x, start, stop, step) but I'll keep it in mind.
Thomas Waldmann:
> do you think this is as good as it gets for this kind of code?
I guess so, there's
Change by Stefan Krah :
--
assignee: -> skrah
___
Python tracker
<https://bugs.python.org/issue34778>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Stefan Krah :
--
nosy: +skrah
___
Python tracker
<https://bugs.python.org/issue35813>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
The patch LGTM, but I'm not sure if we need to document __format__().
Personally I probably wouldn't.
--
___
Python tracker
<https://bugs.python.o
Stefan Krah added the comment:
Yes, these days PRs are the only way to get anything done. Before
GitHub it would have been possible to just commit the small diff
directly to master.
--
___
Python tracker
<https://bugs.python.org/issue23
Stefan Krah added the comment:
For '%b', it looks like the PEP supports it. I didn't follow the PEP
discussions, I think Ethan will know more.
--
___
Python tracker
<http://bugs.pyt
Stefan Krah added the comment:
Not right now, but if anyone makes a PR I can click the merge button. :)
--
___
Python tracker
<http://bugs.python.org/issue24
Stefan Krah added the comment:
Thanks for the PR! -- Merged.
--
assignee: -> skrah
components: +Library (Lib)
resolution: -> fixed
stage: patch review -> resolved
versions: +Python 3.7
___
Python tracker
<http://bugs.python.or
Changes by Stefan Krah :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue24622>
___
___
Python-bugs-list mailing list
Unsubscrib
Stefan Krah added the comment:
Does anyone know how to disable the spurious pull requests that keep coming in?
--
___
Python tracker
<http://bugs.python.org/issue29
Stefan Krah added the comment:
Merged, thank you.
--
assignee: -> skrah
nosy: +skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python
Stefan Krah added the comment:
New changeset 2c0b5c664ba7d36dc09788d3778d5b33e3fa1bd0 by Stefan Krah (Marco
Buttu) in branch 'master':
bpo-30055: add testcleanup to leave a fresh context (#1094)
https://github.com/python/cpython/commit/2c0b5c664ba7d36dc09788d3778d5b
Stefan Krah added the comment:
Thanks, looks good. (I hope GitHub runs the doctests at Travis CI, locally
most of them failed so I didn't bother to run the tests for this one.)
--
assignee: docs@python -> skrah
resolution: -> fixed
stage: -> resolved
status:
Stefan Krah added the comment:
Ok great, maybe I'll take a look.
--
___
Python tracker
<http://bugs.python.org/issue30055>
___
___
Python-bugs-list m
Stefan Krah added the comment:
I thought splitting off abc was done for performance reasons (reduce the number
of imports at Python startup), not for more idiomatic code.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue30
Changes by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<http://bugs.python.org/issue28769>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
I'm with Nathaniel here: The fixed-bug is probably too obscure to warrant ABI
breakage.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/is
Stefan Krah added the comment:
There are 100 results in Google books alone. Are the books wrong (honest
question, I did not check)?
They will be wrong if we remove it. ;)
I agree with Michael that assertNotAlmostEqual() doesn't hurt.
--
nosy: +
Stefan Krah added the comment:
> Do these books have any use cases for assertNotAlmostEqual() or just
> enumerate the list of TestCase methods?
I think this should be researched by the proponent of the change.
--
___
Python tracker
Changes by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<http://bugs.python.org/issue30221>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
I guess since it's documented, it would be ok to change for 3.7. BTW, we also
allow "static inline" now in headers, so perhaps we could make it a function.
--
nosy: +skrah
___
Python tracker
<http
Stefan Krah added the comment:
"Py_buffer view" is stack allocated. One can use memoryviews based on such
buffers *inside* a function, but not return them.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.o
Stefan Krah added the comment:
"Py_buffer view" needs to go into the exporting object. That object needs a
getbufferproc(). That getbufferproc() can use PyBuffer_FillInfo() to fill in
the view that is now kept alive because it's in the object.
The object then supports the
Stefan Krah added the comment:
Sorry, actually I wasn't totally clear: The exporting object just needs a
getbufferproc() that can respond to buffer requests and keeps track of how many
views are exported.
"View in the object" is misleading and not necessary; it can be used for
Stefan Krah added the comment:
> I'd like to use METH_FASTCALL in Cython in a future-proof way.
Also +1. Can we consider the API frozen after this issue or do we have to wait
for #29465 (or others)?
--
___
Python tracker
<http://bugs
Stefan Krah added the comment:
For third party projects who want to use FASTCALL the functions are not
generated by AC. I didn't understand the reasoning why the consistency
argument is weak.
--
___
Python tracker
<http://bugs.py
Stefan Krah added the comment:
To expand on what Mark said: If the proposed format code implicitly
gives these results ...
>>> format(12 % 2**8, '08b')
'1100'
>>> format(-12 % 2**8, '08b')
'0100'
..., would students
Stefan Krah added the comment:
I just noticed that there are other differences, for example the "removal of
trailing zeros" passage does not apply to Decimal:
>>> format(Decimal("1.00e-6"), "g")
'0.0100'
Perhaps it would be e
Stefan Krah added the comment:
On the other hand, the docs say "insignificant trailing zeros are removed from
the significand", so technically it *is* correct, because trailing zeros are
significant in decimal.
--
___
Python track
Stefan Krah added the comment:
Thanks, but it is still not going to happen. Look at the increased code size
in e.g. blake2s_impl.c.h.
I want to know what is going on in the code. Also, the performance
improvements are in argument parsing, but not when you have numerical
code like a * b
Stefan Krah added the comment:
This occurs when handling a recursion error uses more than 50 extra nested
function calls:
if (tstate->overflowed) {
if (tstate->recursion_depth > recursion_limit + 50) {
/* Overflowing while handling an overflow
Stefan Krah added the comment:
It can still be an issue in CPython, like in #14537.
--
___
Python tracker
<https://bugs.python.org/issue36370>
___
___
Python-bug
Stefan Krah added the comment:
The tests pass here on Linux with 3.8 (cc60cdd9c4) and a very low
sys.setrecursionlimit(150).
The fail properly with RecursionError at sys.setrecursionlimit(125).
So I guess we'd need a gdb stack trace from OS X in case there's a CPython
issue th
Stefan Krah added the comment:
Whoops, I tested the wrong branch, getting a proper abort() now. :)
--
___
Python tracker
<https://bugs.python.org/issue36
Stefan Krah added the comment:
The issue is that PyImport_GetModule() can legitimately NULL (not found)
but also NULL after an error occurred in PyDict_GetItemWithError().
So one (quick and dirty) approach that fixes this abort() is:
diff --git a/Python/import.c b/Python/import.c
index
Change by Stefan Krah :
--
stage: -> needs patch
___
Python tracker
<https://bugs.python.org/issue36370>
___
___
Python-bugs-list mailing list
Unsubscrib
Stefan Krah added the comment:
Actually I just see that this behavior of PyImport_GetModule() is documented:
"Return the already imported module with the given name. If the module has not
been imported yet then returns NULL but does not set an error. Returns NULL and
sets an error i
Stefan Krah added the comment:
Like Josh I don't quite understand the problem description. This
for example works:
>>> class C(int):
... def __ipow__(self, other, mod=None):
... return pow(self, other, mod)
...
>>>
>>> x = C(10)
>>> x
1
Stefan Krah added the comment:
Ok, got it. I think __ipow__ should be a ternaryfunc, like so:
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 403f3caaee..914d076b5c 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -7032,7 +7032,7 @@ static slotdef slotdefs
Change by Stefan Krah :
--
stage: -> needs patch
___
Python tracker
<https://bugs.python.org/issue36379>
___
___
Python-bugs-list mailing list
Unsubscrib
Stefan Krah added the comment:
I think the problem is still whether to use 'u' == UCS2 and 'w' == UCS4 like in
PEP-3118.
For the project I'm currently working on I'd need these for buffer exports:
>>> from xnd import *
>>> x = xnd(["a
Stefan Krah added the comment:
Just to demonstrate what the format would look like, this is working
for an array of fixed bytes:
>>> x = xnd([b"123", b"23456"], dtype="fixed_bytes(size=10)")
>>> memoryview(x).format
'10s'
So t
Stefan Krah added the comment:
array() uses struct module characters except for 'u'. PEP-3118 was
supposed to be implemented in the struct module.
If array() continues to use 'u', the only sensible thing would be
to remove (or rename) 'a
Stefan Krah added the comment:
The funny thing is that array() already knows this:
>>> import array
>>> a = array.array("u", "123")
>>> memoryview(a).format
'w'
--
__
Change by Stefan Krah :
--
keywords: +patch
pull_requests: +12454
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Stefan Krah added the comment:
New changeset 027b09c5a13aac9e14a3b43bb385298d549c3833 by Stefan Krah in branch
'master':
bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)
https://github.com/python/cpython/commit/027b09c5a13aac9e14a3b43bb38529
Stefan Krah added the comment:
New changeset cdd8d4d6dd57f4c9429566706009d4613277d391 by Stefan Krah (Miss
Islington (bot)) in branch '3.7':
bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)
https://github.com/python/cpyt
Stefan Krah added the comment:
It looks like 3.6 is in security-fix only mode, so it cannot be backported
there.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.6
___
Pytho
Stefan Krah added the comment:
gcc warns with -pedantic:
ptr.c: In function ‘main’:
ptr.c:5:13: warning: format ‘%p’ expects argument of type ‘void *’, but
argument 2 has type ‘int *’ [-Wformat=]
printf ("%p", &i);
It is pedantic indeed, I wonder if machines with dif
Stefan Krah added the comment:
Yes, I'd think the decisions are deliberate.
Floats follow printf(), this is from the manual for 'e':
"The exponent always contains at least two digits; if the value is zero, the
exponent is 00."
And decimal follows t
Stefan Krah added the comment:
I agree that it is a ctypes issue, itemsize should be equal to
struct.calcsize(fmt), which is never 0 for normal PEP-3118 types like the one
in the example.
[Pedantically, I think that the grammar would allow for an empty record "T{}"
that
Change by Stefan Krah :
--
nosy: +Eric.Wieser
___
Python tracker
<https://bugs.python.org/issue26746>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
Since Terry added me: Yes, this is clearly a bug, but it is a ctypes issue and
not a memoryview issue.
ctypes issues unfortunately tend to take some time until someone reviews.
--
___
Python tracker
<ht
Stefan Krah added the comment:
+16% for float seems pretty high though.
--
___
Python tracker
<https://bugs.python.org/issue27987>
___
___
Python-bugs-list m
Stefan Krah added the comment:
On Mon, Jan 15, 2018 at 12:37:28PM +, Marc-Andre Lemburg wrote:
> If you first set LC_ALL and then one of the other categories such as
> LC_NUMERIC, locale C functions will still use the LC_ALL setting for
> everything. LC_NUMERIC does not ove
Stefan Krah added the comment:
> https://bugs.python.org/issue20767 was showing the issue and imho badly fixed.
You do realize that the fix was proposed by FreeBSD people and that the
upstream Clang issue is still open?
--
nosy: +skrah
___
Pyt
Change by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<https://bugs.python.org/issue32597>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
Well, they had ample time to articulate themselves. :)
--
___
Python tracker
<https://bugs.python.org/issue20767>
___
___
Pytho
Stefan Krah added the comment:
I'll take a look.
--
assignee: -> skrah
___
Python tracker
<https://bugs.python.org/issue32630>
___
___
Python-bugs-lis
Stefan Krah added the comment:
I realize that you had to fight massive mailing list distractions
during the PEP discussions, but this is very close to the beta ...
Let's start here:
>>> from decimal import *
==18887== Invalid read of size 8
==18887==at 0x5324E0: contextvar_
Change by Stefan Krah :
--
priority: release blocker -> normal
___
Python tracker
<https://bugs.python.org/issue32630>
___
___
Python-bugs-list mailing list
Un
Stefan Krah added the comment:
Sure, and *I* am the one running the extended decimal test suite as we speak,
not Guido.
You are playing power games here, and you did that from the start by choosing
the nosy list.
--
___
Python tracker
<ht
Stefan Krah added the comment:
Tests
-
I ran some of my own tests (not even close to all), they seem fine.
However, I could not find any tests for the added feature (safe
use with async) though. We would be adding a new feature without
tests.
Performance
---
I'm getting a
Stefan Krah added the comment:
On Fri, Jan 26, 2018 at 09:06:38PM +, Yury Selivanov wrote:
> This benchmark is specially constructed to profile creating decimal contexts
> and doing almost nothing with the
It is not constructed at all. It was the first thing I wrote down trying
to
Stefan Krah added the comment:
Guido, I have the feeling that the feature -- about which I was actually
positive in the first place -- is being pushed aggressively with no
respect for the module author.
BTW, prec is changed quite frequently in decimal code, so if people
want infix notation
Stefan Krah added the comment:
I have run about 1000 times more decimal benchmarks than both Yury and you.
You attempt to hurt my reputation is laughable.
Show me some top-performance code that you have written.
--
___
Python tracker
<ht
Stefan Krah added the comment:
Yury, would you be willing to work this out by email? -- I think it
was you who I discussed the context-subclassing with and that was
quite a pleasant experience.
--
___
Python tracker
<https://bugs.python.
Stefan Krah added the comment:
Guido, I apologize for the outburst. I had the impression that
msg310799 implicitly asserted my incompetence in benchmarking.
--
___
Python tracker
<https://bugs.python.org/issue32
Stefan Krah added the comment:
On Fri, Jan 26, 2018 at 11:11:00PM +, STINNER Victor wrote:
> vstinner@apu$ ./python -m perf compare_to master.json pr5278.json
> Mean +- std dev: [master] 1.86 us +- 0.03 us -> [pr5278] 2.27 us +- 0.04 us:
> 1.22x slower (+22%)
>
> N
Stefan Krah added the comment:
You have two options:
a) ./configure CFLAGS="-O0 -g" --without-pymalloc
b) ./configure CFLAGS="-O0 -g" --with-valgrind
For b) you need the Valgrind headers installed.
--with-pydebug is always wrong when using Valgrind.
--
Change by Stefan Krah :
--
resolution: -> not a bug
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue32848>
___
___
Python-bugs-list
Stefan Krah added the comment:
I agree with Mark's mailing list statements: There is no ambiguity
for decimal, given that the existing predicates ignore the context.
--
___
Python tracker
<https://bugs.python.org/is
Stefan Krah added the comment:
In effect:
"!(Py_IS_FINITE(dx) && dx == floor(dx))"
I don't understand why Robert is questioned so much. mpd_as_integer() (or
rather the optimized version _mpd_isint() is used all over the place inside
libm
Stefan Krah added the comment:
libmpdec is an example of numerical code. I don't think anyone but you has
argued that is_integer() is useless in numerical code. Whether it is float or
decimal doesn't matter.
I get the API-bloat argument, but I'm completely surprised th
Change by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<https://bugs.python.org/issue26680>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<https://bugs.python.org/issue33083>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
I fixed PyBuffer_ToContiguous() in 3.3, PyBuffer_FromContiguous() was broken
until #23370.
For a start, here's a doc patch for PyBuffer_ToContiguous().
PyBuffer_FromContiguous() does the opposite and loads a contiguous buffer
into a possibly non-contiguous
Stefan Krah added the comment:
Yes, the signatures are weird. In PyBuffer_FromContiguous(), "len" is
the size of "buf" in bytes.
If "buf" contains 6 floats, but "view" only has space for 4, then only
4 are copied into "view".
To avoid that s
Stefan Krah added the comment:
And if view->len > len in PyBuffer_FromContiguous(), then
view will contain uninitialized bytes, which is bad.
--
___
Python tracker
<https://bugs.python.org/i
Stefan Krah added the comment:
I don't have OS X. However, this is the first time in 6 years that anyone has
reported an OS X build failure.
Perhaps Ned knows the answer.
--
nosy: +ned.deily, skrah
___
Python tracker
<https://bugs.py
Stefan Krah added the comment:
It looks to me as if you are compiling --with-system-libmpdec.
You don't need that, libmpdec is included in the Python tarball.
-with-system-libmpdec was added mainly for Linux distros. If there's a
widespread interest to support it on OS X, I'
Stefan Krah added the comment:
Another source of error is of course if the external libmpdec was not compiled
as "universal" but Python is.
--
___
Python tracker
<https://bugs.python.o
Stefan Krah added the comment:
I'm trying to reduce the number of open issues that I'm involved in.
If something concrete comes up, feel free to reopen.
--
resolution: -> works for me
stage: -> resolved
status: open -> closed
___
Stefan Krah added the comment:
I guess I don't really see much of an issue: The first link for "PIL Python"
goes Pillow page and since Pillow is just a fork, the technical term is IMHO
"PIL-style".
I like to give c
Stefan Krah added the comment:
I think I want to leave it as is. Probably no one is using suboffsets anyway.
:-)
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Stefan Krah added the comment:
MSVC optimizes memcpy() to an assignment, sometimes too well (pgo):
https://bugs.python.org/issue15993
But that is fixed long ago, so I also think that the memcpy() approach is best.
--
___
Python tracker
<ht
Stefan Krah added the comment:
> We see if digits * bits_per_char + PyLong_SHIFT -1 overflows an int?
Yes, but the check is too late: UB can already occur in this calculation
and then all bets are off.
It looks like 'n' was Py_ssize_t in 2.7. :)
--
Stefan Krah added the comment:
Does the difference stay at 10-15% if you run it 5 times or is it
a one time cost of around 100 ms?
--
nosy: +skrah
___
Python tracker
<https://bugs.python.org/issue31
Stefan Krah added the comment:
OpenBSD reduces to the range [-pi/4,pi/4]:
https://github.com/openbsd/src/blob/master/lib/libm/src/s_tan.c
According to the man page on i386:
http://man.openbsd.org/FreeBSD-11.0/math.3
"Argument reduction is not performed accurately for huge argu
1201 - 1300 of 3396 matches
Mail list logo