[issue35845] Can't read a F-contiguous memoryview in physical order

2019-01-28 Thread Stefan Krah
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

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-29 Thread Stefan Krah
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

[issue35845] Can't read a F-contiguous memoryview in physical order

2019-02-01 Thread Stefan Krah
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

[issue35845] Can't read a F-contiguous memoryview in physical order

2019-02-01 Thread Stefan Krah
Change by Stefan Krah : -- keywords: +patch, patch pull_requests: +11620, 11621 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35845] Can't read a F-contiguous memoryview in physical order

2019-02-01 Thread Stefan Krah
Change by Stefan Krah : -- keywords: +patch pull_requests: +11620 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35845] Can't read a F-contiguous memoryview in physical order

2019-02-02 Thread Stefan Krah
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

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-02-02 Thread Stefan Krah
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

[issue26256] Fast decimalisation and conversion to other bases

2019-02-02 Thread Stefan Krah
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

[issue26256] Fast decimalisation and conversion to other bases

2019-02-02 Thread Stefan Krah
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

[issue26256] Fast decimalisation and conversion to other bases

2019-02-02 Thread Stefan Krah
Change by Stefan Krah : -- assignee: docs@python -> skrah resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python

[issue35845] Can't read a F-contiguous memoryview in physical order

2019-02-02 Thread Stefan Krah
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/

[issue35686] BufferError with memory.release()

2019-02-02 Thread Stefan Krah
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

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-02-05 Thread Stefan Krah
Change by Stefan Krah : -- assignee: -> skrah ___ Python tracker <https://bugs.python.org/issue34778> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-05 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +skrah ___ Python tracker <https://bugs.python.org/issue35813> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah
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

[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah
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

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2017-03-07 Thread Stefan Krah
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

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
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

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
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

[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2017-03-14 Thread Stefan Krah
Changes by Stefan Krah : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue24622> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue29534] _decimal difference with _pydecimal

2017-03-31 Thread Stefan Krah
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

[issue29969] Typo in decimal error message

2017-04-03 Thread Stefan Krah
Stefan Krah added the comment: Merged, thank you. -- assignee: -> skrah nosy: +skrah resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python

[issue30055] Missed testcleanup in decimal.rst

2017-04-13 Thread Stefan Krah
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

[issue30055] Missed testcleanup in decimal.rst

2017-04-13 Thread Stefan Krah
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:

[issue30055] Missed testcleanup in decimal.rst

2017-04-13 Thread Stefan Krah
Stefan Krah added the comment: Ok great, maybe I'll take a look. -- ___ Python tracker <http://bugs.python.org/issue30055> ___ ___ Python-bugs-list m

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Stefan Krah
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

[issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *"

2017-04-26 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: -skrah ___ Python tracker <http://bugs.python.org/issue28769> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-28 Thread Stefan Krah
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

[issue30221] Deprecate assertNotAlmostEqual

2017-05-01 Thread Stefan Krah
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: +

[issue30221] Deprecate assertNotAlmostEqual

2017-05-01 Thread Stefan Krah
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

[issue30221] Deprecate assertNotAlmostEqual

2017-05-01 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: -skrah ___ Python tracker <http://bugs.python.org/issue30221> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Stefan Krah
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

[issue30527] PyMemoryView_FromBuffer memory leak

2017-05-31 Thread Stefan Krah
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

[issue30527] PyMemoryView_FromBuffer memory leak

2017-05-31 Thread Stefan Krah
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

[issue30527] PyMemoryView_FromBuffer memory leak

2017-05-31 Thread Stefan Krah
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

[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-06-05 Thread Stefan Krah
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

[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-06-05 Thread Stefan Krah
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

[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

2017-06-12 Thread Stefan Krah
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

[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-24 Thread Stefan Krah
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

[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-24 Thread Stefan Krah
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

[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2019-03-20 Thread Stefan Krah
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

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
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

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
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

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
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

[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: Whoops, I tested the wrong branch, getting a proper abort() now. :) -- ___ Python tracker <https://bugs.python.org/issue36

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-20 Thread Stefan Krah
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

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-20 Thread Stefan Krah
Change by Stefan Krah : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue36370> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-20 Thread Stefan Krah
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

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
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

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
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

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
Change by Stefan Krah : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue36379> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah
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

[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah
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

[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah
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&#x

[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah
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' -- __

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-22 Thread Stefan Krah
Change by Stefan Krah : -- keywords: +patch pull_requests: +12454 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-25 Thread Stefan Krah
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

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-25 Thread Stefan Krah
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

[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-25 Thread Stefan Krah
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

[issue36594] Undefined behavior due to incorrect usage of %p in format strings

2019-04-13 Thread Stefan Krah
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

[issue36622] Inconsistent exponent notation formatting

2019-04-14 Thread Stefan Krah
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

[issue32782] memoryview & ctypes: incorrect itemsize for empty array

2019-04-14 Thread Stefan Krah
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

[issue26746] struct.pack(): trailing padding bytes on x64

2019-04-21 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +Eric.Wieser ___ Python tracker <https://bugs.python.org/issue26746> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs

2019-04-21 Thread Stefan Krah
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

[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Stefan Krah
Stefan Krah added the comment: +16% for float seems pretty high though. -- ___ Python tracker <https://bugs.python.org/issue27987> ___ ___ Python-bugs-list m

[issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding

2018-01-15 Thread Stefan Krah
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

[issue32597] Bad detection of clang

2018-01-20 Thread Stefan Krah
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

[issue32597] Bad detection of clang

2018-01-22 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue32597> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20767] Some python extensions can't be compiled with clang 3.4

2018-01-22 Thread Stefan Krah
Stefan Krah added the comment: Well, they had ample time to articulate themselves. :) -- ___ Python tracker <https://bugs.python.org/issue20767> ___ ___ Pytho

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-23 Thread Stefan Krah
Stefan Krah added the comment: I'll take a look. -- assignee: -> skrah ___ Python tracker <https://bugs.python.org/issue32630> ___ ___ Python-bugs-lis

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah
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_

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah
Change by Stefan Krah : -- priority: release blocker -> normal ___ Python tracker <https://bugs.python.org/issue32630> ___ ___ Python-bugs-list mailing list Un

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-25 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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.

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah
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

[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-27 Thread Stefan Krah
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

[issue32848] Valgrind error with python

2018-02-15 Thread Stefan Krah
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. --

[issue32848] Valgrind error with python

2018-02-15 Thread Stefan Krah
Change by Stefan Krah : -- resolution: -> not a bug status: open -> closed ___ Python tracker <https://bugs.python.org/issue32848> ___ ___ Python-bugs-list

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-12 Thread Stefan Krah
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

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Stefan Krah
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

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Stefan Krah
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

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue26680> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-15 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue33083> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33126] Some C buffer protocol APIs not documented

2018-03-24 Thread Stefan Krah
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

[issue33126] Some C buffer protocol APIs not documented

2018-03-25 Thread Stefan Krah
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

[issue33126] Some C buffer protocol APIs not documented

2018-03-25 Thread Stefan Krah
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

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-05 Thread Stefan Krah
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

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-06 Thread Stefan Krah
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'

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-06 Thread Stefan Krah
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

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-10 Thread Stefan Krah
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 ___

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Stefan Krah
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

[issue33310] Update references to PIL-style arrays

2018-04-18 Thread Stefan Krah
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

[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2018-05-13 Thread Stefan Krah
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

[issue31619] Strange error when convert hexadecimal with underscores to int

2017-09-29 Thread Stefan Krah
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. :) --

[issue31555] Windows pyd slower when not loaded via load_dynamic

2017-09-30 Thread Stefan Krah
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

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-01 Thread Stefan Krah
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

<    8   9   10   11   12   13   14   15   16   17   >