[issue35949] Move PyThreadState into Include/internal/pycore_pystate.h

2019-02-18 Thread Stefan Behnel
Stefan Behnel added the comment: Well … yes. The exception fields are performance critical, and we try hard to make them visible to the C compiler so that swapping around exception state eats up as little CPU time as possible. You could argue that profiling and tracing are less critical

[issue29709] Short-circuiting not only on False and True

2017-03-03 Thread Stefan Pochmann
New submission from Stefan Pochmann: The notes at https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not say that `or` "only evaluates the second argument if the first one is False" and that `and` "only evaluates the second argument if the first one is

[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:

[issue30365] Backport warnings in ElementTree/cElementTree modules and fix bugs

2017-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: Looks good to me (didn't test it). Note that getchildren() is not deprecated in lxml because it's actually the fastest way to build a list of the children. It's faster than list(element) because it avoids the Python (C-level) iteration overhead

[issue30403] Running extension modules using -m switch

2017-05-25 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for bringing me in. The PoC implementation looks nice. Whether I'd like to support this in Cython? Absolutely. Requires some work, though, since Cython still doesn't implement PEP 489. But it shouldn't be hard, if I remember the discus

[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

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Stefan Behnel added the comment: Agreed that this should be added. I think the key should be None, though, not the empty string. I attached a quick patch for lxml's corresponding file. It's mostly the same for ET. -- keywords: +patch Added file: http://bugs.python.org

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Changes by Stefan Behnel : Removed file: http://bugs.python.org/file46906/lxml_elpath_empty_prefix.patch ___ Python tracker <http://bugs.python.org/issue30485> ___ ___

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Stefan Behnel added the comment: Patch replaced by pull request. https://github.com/python/cpython/pull/1823 -- ___ Python tracker <http://bugs.python.org/issue30

[issue30496] Incomplete traceback with `exec`

2017-05-28 Thread Stefan Seefeld
New submission from Stefan Seefeld: The following code is supposed to catch and report errors encountered during the execution of a (python) script: ``` import traceback import sys try: env = {} with open('script') as f: exec(f.read(), env) except: type_,

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: Some further experiements: Replacing the `exec(f.read(), env)` line by ``` code = compile(f.read(), 'script', 'exec') exec(code, env) ``` exhibits the same behaviour. If I remove the `try...except`, the correct (full) traceback is printed o

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: Answering my own question: It appears I can get the location of a syntax error by inspecting the raised `SyntaxError`, which solves my specific use-case. The bug remains, though: The traceback is incomplete if it stems from a syntax error

[issue30496] Incomplete traceback with `exec` on SyntaxError

2017-05-29 Thread Stefan Seefeld
Stefan Seefeld added the comment: OK, fair enough, that makes sense. As I said, in my last message, I was mainly simply trying to figure out the exact location of the error in the executed script, which I got from inspecting the SyntaxError. So if all of this is expected behaviour, I think we

[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

[issue30534] error message for incorrect call degraded in 3.7

2017-05-31 Thread Stefan Behnel
New submission from Stefan Behnel: I'm seeing doctest failures in Cython's test suite with Py3.7 due to the change of an error message: Failed example: func1(arg=None) Expected: Traceback (most recent call last): ... TypeError: func1() takes no keyword arg

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

2017-06-04 Thread Stefan Behnel
Stefan Behnel added the comment: I looked up this change again and was surprised that it still wasn't applied. It feels to me that it makes sense already for reasons of consistency. Any time frame for changing it? I'd like to use METH_FASTCALL in Cython in a future

[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

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

2017-06-12 Thread Stefan Behnel
Stefan Behnel added the comment: I do not see this as a matter of performance but as a matter of usability. Basically, CPython could do just fine with just a single catch-all calling convention that packs all pos/kw arguments into C arguments and passes them over, leaving it entirely to the

[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

[issue36119] Can't add/append in set/list inside shared dict

2019-02-26 Thread Andrei Stefan
New submission from Andrei Stefan : I'm creating a shared dict for multiprocessing purposes: from multiprocessing import Manager manager = Manager() shared_dict = manager.dict() If I add a set or a list as a value in the dict: shared_dict['test'] = set() or shared_dict[

[issue36144] Dictionary addition.

2019-02-28 Thread Stefan Behnel
Stefan Behnel added the comment: > We already have a syntax for dict merging: {**d1, **d2}. Which doesn't mean that "d1 + d2" isn't much more intuitive than this special-character heavy version. It takes me a while to see the dict merge under that heap of stars.

[issue36144] Dictionary addition.

2019-03-04 Thread Stefan Behnel
Stefan Behnel added the comment: > should we also implement +/+= for sets? The question is: what would that do? The same as '|=' ? That would be rather confusing, I think. "|" (meaning: "or") seems a very natural operation for sets, in the same way that

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Stefan Behnel
Stefan Behnel added the comment: The feature seems reasonable to me and the patch looks good. -- ___ Python tracker <https://bugs.python.org/issue36227> ___ ___

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-08 Thread Stefan Behnel
Stefan Behnel added the comment: lxml does not support the "default_namespace" option specifically (because its tree model preserves namespace prefixes), but it generally makes all (justifiable) serialisation options available to both tostring() and ET.write(). I think the same sh

[issue36233] xml ElementTree quotation marks of xml version string

2019-03-08 Thread Stefan Behnel
Stefan Behnel added the comment: While I do understand the interest in a bit more visual consistency (and, lacking further input, I assume that this is the OP's "problem"), it really is at best a purely visual improvement with the potential to break code and/or tests out th

[issue35830] building multiple (binary) packages from a single project

2019-03-08 Thread Stefan Seefeld
Change by Stefan Seefeld : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34160] ElementTree not preserving attribute order

2019-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, I second Raymond's opposition against a new option. It's really not something that users should care about. Instead of us providing a new "sort or not" option, and people adding it (conditionally!) to their code to "fix" p

[issue34160] ElementTree not preserving attribute order

2019-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: Ned, would it solve your problem to write a helper function that walks the tree and sorts the attrib dicts? That would also work in all existing CPython versions (because they already sort attributes anyway), for both ElementTree and lxml, and you wouldn&#

[issue34160] ElementTree not preserving attribute order

2019-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: Something like this: def sort_attributes(root): for el in root.iter(): attrib = el.attrib if len(attrib) > 1: attribs = sorted(attrib.items()) attrib.clear() attrib.update(attr

[issue34160] ElementTree not preserving attribute order

2019-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: :) The coolest thing about it is: it's not a hack at all. It's simply making use of the new feature in a suitable way. -- ___ Python tracker <https://bugs.python.o

[issue34160] ElementTree not preserving attribute order

2019-03-18 Thread Stefan Behnel
Stefan Behnel added the comment: Victor, as much as I appreciate backwards compatibility, I really don't think it's a big deal in this case. In fact, it might not even apply. My (somewhat educated) gut feeling is that most users simply won't care or won't even notic

[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue36346> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for implementing this, Serhiy. Since these C macros are public, should they be named PY_* ? -- ___ Python tracker <https://bugs.python.org/issue36

[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel
Stefan Behnel added the comment: I think this is a good preparation that makes it clear what code will eventually be removed, and allows testing without it. No idea how happy Windows users will be about all of this, but I consider it quite an overall improvement for the Unicode

[issue36346] Prepare for removing the legacy Unicode C API

2019-03-18 Thread Stefan Behnel
Stefan Behnel added the comment: I had also looked through the unrelated changes, and while, yes, they are unrelated, they seemed to be correct and reasonable modernisations of the code base while touching it. They could be moved to a separate PR, but there is a relatively high risk of

[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

[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel
Stefan Behnel added the comment: I concur with Serhiy that the bug is in OpenCV (or its parser project), and that it is best solved there. Otherwise, we would create a dependency on a future/recent Python version for exporting XML to it

[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel
Stefan Behnel added the comment: As a work-around, you can provide your own XML declaration (or not) and pass "xml_declaration=False" into ElementTree.write() to prevent it from adding one. UTF-8 encoded XML is ok without such a d

[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

[issue36407] xml.dom.minidom wrong indentation writing for CDATA section

2019-03-23 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, this case is incorrect. Pretty printing should not change character content inside of a simple tag. The PR looks good to me. -- versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue36

[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

[issue36407] xml.dom.minidom wrong indentation writing for CDATA section

2019-03-27 Thread Stefan Behnel
Stefan Behnel added the comment: I don't think this should be backported. Pretty-printing is not a production relevant feature, more of a "debugging, diffing and help users see what they get" kind of feature. It's good to have it fixed for the future, but we shouldn&#x

[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: It's currently implemented as a positional argument, not a keyword argument. Thus the "/" at the end of the signature in the help text. That also suggests that it was a conscious decision, not an oversight. Personally, I'd also prefer it

[issue36491] sum function's start optional parameter documented in help but not implemented

2019-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, duplicate of issue34637. -- ___ Python tracker <https://bugs.python.org/issue36491> ___ ___ Python-bugs-list mailin

[issue34160] ElementTree not preserving attribute order

2019-03-31 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks to the discussion that rhettinger triggered on python-dev, it seems that there is a majority accordance for considering the previous ordering "undefined but deterministic" rather than "sorted", and for making the change from &qu

[issue36493] Add math.midpoint(a,b) function

2019-03-31 Thread Stefan Behnel
New submission from Stefan Behnel : I recently read a paper¹ about the difficulty of calculating the most exact midpoint between two floating point values, facing overflow, underflow and rounding errors. The intention is to assure that the midpoint(a,b) is - actually within the interval [a,b

[issue36493] Add math.midpoint(a,b) function

2019-04-01 Thread Stefan Behnel
Stefan Behnel added the comment: I buy the YAGNI argument and won't fight for this. Thanks for your input. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue36512] future_factory argument for Thread/ProcessPoolExecutor

2019-04-02 Thread Stefan Hölzl
New submission from Stefan Hölzl : adding a future_factory argument to Thread/ProcessPoolExecutor to control which type of Future should be created by Executor.submit -- components: Library (Lib) messages: 339364 nosy: stefanhoelzl priority: normal severity: normal status: open title

[issue36512] future_factory argument for Thread/ProcessPoolExecutor

2019-04-02 Thread Stefan Hölzl
Change by Stefan Hölzl : -- keywords: +patch pull_requests: +12596 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36512> ___ ___ Py

[issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml'

2019-04-03 Thread Stefan Behnel
Stefan Behnel added the comment: Seems like a reasonable request to me, even if it hasn't been touched or re-requested for years. Funny enough, DocumentFragment is currently documented as "not implemented" (as for Entity, Notation, CDATASection, CharacterData, DO

[issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml'

2019-04-03 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +12604 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue9883> ___ ___ Py

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-04-04 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34396> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34160] ElementTree not preserving attribute order

2019-04-09 Thread Stefan Behnel
Stefan Behnel added the comment: This is done now. Thanks everyone who helped in discussing and implementing this change. I will leave Serhiy's last PR (adding the "sort_attrs" flag option) open for a while until I'm sure we have a better solution for comparing XML in 3.

[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

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset ffca16e25a70fd44a87b13b379b5ec0c7a11e926 by Stefan Behnel (Bernt Røskar Brenna) in branch 'master': bpo-36227: ElementTree.tostring() default_namespace and xml_declaration arguments (GH-12225) https://github.com/python/cpyt

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset e9927e1820caea01e576141d9a623ea394d43dad by Stefan Behnel in branch 'master': bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823) https://github.com/python/cpyt

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: I've merged the PR. It matches the implementation that has been released in lxml almost two years ago. -- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3

[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: Thank you for you contribution. -- components: +XML resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue31658] xml.sax.parse won't accept path objects

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: PR looks good to me. Doesn't look critical enough for a backport, though. -- nosy: +scoder versions: -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/is

[issue31658] xml.sax.parse won't accept path objects

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 929b70473829f04dedb8e802abcbd506926886e1 by Stefan Behnel (Mickaël Schoentgen) in branch 'master': bpo-31658: Make xml.sax.parse accepting Path objects (GH-8564) https://github.com/python/cpython/commit/929b70473829f04dedb8e802abcbd5

[issue31658] xml.sax.parse won't accept path objects

2019-04-14 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue31658] xml.sax.parse won't accept path objects

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for your contribution. -- ___ Python tracker <https://bugs.python.org/issue31658> ___ ___ Python-bugs-list mailin

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: The intended interface seems to be to change .name rather than .localName, so yes, that should be documented somewhere. The implementation seems a bit funny in that a "self._localName", if set, takes precedence, but there doesn't seem to be

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +12755 ___ Python tracker <https://bugs.python.org/issue30485> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    14   15   16   17   18   19   20   21   22   23   >