[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

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

[issue36798] f-strings do not support top-level :=

2019-05-05 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, I think it's equally reasonable to allow assignment expressions directly in f-strings, as it is to require parentheses with a reference to the invalidity of top-level expressions. That makes me lean towards adding a parse-time error message

[issue36811] Warning when compiling _elementree.c

2019-05-06 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +13024 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36811> ___ ___ Py

[issue36811] Warning when compiling _elementree.c

2019-05-06 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 6b95149eccac540a911a5ada03fcb7d623a0de37 by Stefan Behnel in branch 'master': bpo-36811: Fix a C compiler warning in _elementtree.c. (GH-13109) https://github.com/python/cpython/commit/6b95149eccac540a911a5ada03fcb7

[issue36811] Warning when compiling _elementree.c

2019-05-06 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the report. In simple cases like this, I think it's fine to comment in the original ticket and/or pull request. There's no real need for a dedicated ticket, at least not before an official release. -- resolution: -> fixed

[issue25541] Wrong usage of sockaddr_un struct for abstract namespace unix sockets

2019-05-06 Thread Stefan Behnel
Stefan Behnel added the comment: Looks like the issue was originally reported against Python 3.4. -- ___ Python tracker <https://bugs.python.org/issue25

[issue25541] Wrong usage of sockaddr_un struct for abstract namespace unix sockets

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

[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-08 Thread Stefan Behnel
Stefan Behnel added the comment: Right, thanks for the reproducer. The default namespace should not apply to attributes. I'll write up a PR today. -- ___ Python tracker <https://bugs.python.org/is

[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-08 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +13112 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-08 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 88db8bd0648588c67eeab16d0bc72ec5c206e3ad by Stefan Behnel in branch 'master': bpo-36831: Do not apply default namespace to unprefixed attributes in ElementPath. (#13201) https://github.com/python/cpyt

[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-08 Thread Stefan Behnel
Stefan Behnel added the comment: Sorry for the annoyance during the release. -- keywords: -patch resolution: -> fixed stage: patch review -> needs patch status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36831] ElementTree.find attribute matching with empty namespace

2019-05-08 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: needs patch -> resolved ___ Python tracker <https://bugs.python.org/issue36831> ___ ___ Python-bugs-list mailing list Un

[issue36676] Make ET.XMLParser target aware of namespace prefixes

2019-05-09 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +13136 ___ Python tracker <https://bugs.python.org/issue36676> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36676] Make ET.XMLParser target aware of namespace prefixes

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset e9a465f3ea22c61e05ffe7b44a69102b25f57db4 by Stefan Behnel in branch 'master': bpo-36676: Update what's new document. (#13226) https://github.com/python/cpython/commit/e9a465f3ea22c61e05ffe7b44

[issue36874] Support CDATA by xml.etree.(c)ElementTree

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: PR welcome. This is how lxml implements it: https://lxml.de/api.html#cdata Tests are here: https://github.com/lxml/lxml/blob/1a2db33aa8b9619c1caf407167567d5cca0b9019/src/lxml/tests/test_etree.py#L1692-L1749 I guess it won't look perfectly the sa

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: I think this is resolved by issue 36673 (Py3.8). Please try it in the just released alpha4. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue33303] ElementTree Comment text isn't escaped

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, sorry, I was wrong here. I looked it up and also checked the behaviour of other libraries: the data content of PIs is application specific and must not be escaped, at all. It's not XML character data. Sorry for the confusion and the extra work on

[issue36885] Clean up makeunicode.py script

2019-05-11 Thread Stefan Behnel
New submission from Stefan Behnel : The code generation in the makeunicode.py script is more difficult to read than necessary due to the many use of "print(file=fp)" everywhere. Moving the "file" argument out of the way makes it easier to read through the actual code that

[issue36885] Clean up makeunicode.py script

2019-05-11 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +13154 ___ Python tracker <https://bugs.python.org/issue36885> ___ ___ Python-bugs-list mailin

[issue36885] Make makeunicode.py script more readable

2019-05-11 Thread Stefan Behnel
Change by Stefan Behnel : -- title: Clean up makeunicode.py script -> Make makeunicode.py script more readable ___ Python tracker <https://bugs.python.org/issu

[issue33303] ElementTree Comment text isn't escaped

2019-05-12 Thread Stefan Behnel
Stefan Behnel added the comment: I'm really sorry again, but I only consulted the XML spec on this now (and also the way libxml2 does it), and I found that XML comment text actually does not get escaped. It's not character data, and, in fact, "--" is not even allow

[issue3020] doctest should have lib2to3 integration

2019-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: I'm closing this old ticket. Python 2 will be dead by the time someone gets around to do something about it. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python t

[issue29209] Remove old-deprecated ElementTree features

2018-01-13 Thread Stefan Behnel
Stefan Behnel added the comment: Patch looks right to me. I'd personally be ok with applying it to 3.7, but I'll leave the decision to you. Most of the removed "features" are non-controversial, except: - "getchildren()" is probably still in use, also because i

[issue28716] Fractions instantiation revisited

2018-01-22 Thread Stefan Behnel
Stefan Behnel added the comment: Not sure if it's relevant for this specific change, but here's a benchmark that you could use for Fractions: issue22458 -- nosy: +scoder ___ Python tracker <https://bugs.python.o

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-02-17 Thread Stefan Behnel
Stefan Behnel added the comment: The latest "fixed2" patch looks good to me, but the author didn't sign a contributors agreement. However, I did, and I already wrote the same thing for lxml, so I put together an initial PR. -- type: behavior -> enhancement ver

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-02-17 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +5508 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue20928> ___ ___ Python-bugs-list mai

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-02-18 Thread Stefan Behnel
Stefan Behnel added the comment: > The check may miss infinite recursions if the hrefs happen to be written in > non-matching but equivalent forms. Ex: relative versus absolute paths. I thought about that, too, but it's not a real problem. There are only a few different ways t

[issue32388] Remove cross-version binary compatibility

2018-02-19 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue32388> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32387] Disallow untagged C extension import on major platforms

2018-02-19 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue32387> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2018-02-19 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue32856> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-02-23 Thread Stefan Behnel
Stefan Behnel added the comment: I've added a 'max_depth' argument to limit the maximum recursive include depth to 6 by default (which is a small, arbitrarily chosen value). Users can set it to None to disable the limit. >From my side, I don't see any more features th

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-24 Thread Stefan Behnel
Stefan Behnel added the comment: An obvious optimisation, if you ask me. PR looks good to me superficially, but I don't know the AST code well. -- nosy: +scoder ___ Python tracker <https://bugs.python.org/is

[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Stefan Behnel
Stefan Behnel added the comment: sorted() *does* convert its input to a list first, and only then sorts it. It calls PySequence_List() for that, which in turn uses list_extend(), which then applies the obvious optimisation of copying input lists (and tuples) directly. What you are seeing

[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Stefan Behnel
Stefan Behnel added the comment: The constant function call overhead doesn't make a big difference: $ /opt/python3.7-opt/bin/python3 -m timeit 'list(i for i in range(1000))' 5000 loops, best of 5: 55 usec per loop $ /opt/python3.7-opt/bin/python3 -m timeit '[i for i in

[issue32945] sorted(generator) is slower than sorted(list-comprehension)

2018-02-25 Thread Stefan Behnel
Stefan Behnel added the comment: > as `range` may have been shadowed at that point No, range() has in fact already been executed at that point. And it returned an iterable that knows its length (search for "LengthHint" in the CP

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Stefan Behnel
Change by Stefan Behnel : -- components: +Extension Modules nosy: +scoder ___ Python tracker <https://bugs.python.org/issue32973> ___ ___ Python-bugs-list mailin

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-03-02 Thread Stefan Behnel
Stefan Behnel added the comment: > change the extension module cache to key on filename and init function name ... or on the pointer to the PyInit function. If that's the same, we obviously have the same extension module. If it differs, even for the same module name, then other gl

[issue32388] Remove cross-version binary compatibility

2018-03-03 Thread Stefan Behnel
Stefan Behnel added the comment: I'm ok with "removing" this "guarantee" (although it seems too late to apply this specific change to 3.7 now). While Cython users do ask for a way to build cross-version binaries from time to time, it's neither supported n

[issue28716] Fractions instantiation revisited

2018-03-04 Thread Stefan Behnel
Stefan Behnel added the comment: Just FYI and as further motivation, I reimplemented this dedicated parser for quicktions (in Cython, so the timings and speedups are not comparable). https://github.com/scoder/quicktions/commit/cc034e07325ec492decdb7b1bcca69246cc780fd I was able to get

[issue32476] Add concat functionality to ElementTree xpath find

2018-03-16 Thread Stefan Behnel
Stefan Behnel added the comment: I can't see why this should be restricted to attribute values and not text content in general. Therefore, I would suggest adding general support for functions, and making this only a special case. Otherwise, this would only solve a very niche problem

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-03-30 Thread Stefan Behnel
New submission from Stefan Behnel : The ElementInclude module in ElementTree seems undocumented. I couldn't find any documentation in the stdlib docs. Pretty much the only source that I could find is here: http://effbot.org/zone/element-xinclude.htm I noticed it while looking for a pla

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: There seems to be no documentation currently for ElementInclude. Would be nice if someone who's interested in this feature could take the time to write something up. I created a documentation ticket as issue #

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: PR is complete now, ready for merging. -- ___ Python tracker <https://bugs.python.org/issue20928> ___ ___ Python-bugs-list mailin

[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel
Stefan Behnel added the comment: Right, Zachary, thanks for noticing. Py2.7 is actually way more different than I thought, and I hadn't paid enough attention to that. Py3 does all of this in "__init__", whereas Py2 essentially implements "__new__" in C, which requires

[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +6034 stage: resolved -> patch review ___ Python tracker <https://bugs.python.org/issue31455> ___ ___ Python-

[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-31 Thread Stefan Behnel
Stefan Behnel added the comment: PR 6318 fixes the reference leak for Py2.7. -- ___ Python tracker <https://bugs.python.org/issue31455> ___ ___ Python-bugs-list m

[issue33189] pygettext doesn't work with f-strings

2018-04-01 Thread Stefan Behnel
Stefan Behnel added the comment: Is there really a use case for this? I would normally expect place holders to get replaced *after* translation, i.e. in the translated text, not before. -- nosy: +scoder ___ Python tracker <https://bugs.python.

[issue32797] Tracebacks from Cython modules no longer work

2018-05-04 Thread Stefan Behnel
Change by Stefan Behnel : -- type: -> behavior versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issu

[issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__

2018-05-06 Thread Stefan Behnel
Stefan Behnel added the comment: > cmp(a,b) can be replaced with (a>b)-(a b" and "a < b" both return something that supports the minus operator, such as a boolean value. That might not be the case, and it is definitely impossible to infer automatically from a given

[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-25 Thread Stefan Behnel
Stefan Behnel added the comment: Any comments on this? -- ___ Python tracker <https://bugs.python.org/issue31465> ___ ___ Python-bugs-list mailing list Unsub

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-25 Thread Stefan Behnel
Stefan Behnel added the comment: Still ready for merging :) -- ___ Python tracker <https://bugs.python.org/issue31336> ___ ___ Python-bugs-list mailing list Unsub

[issue31580] Defer compiling regular expressions

2017-09-26 Thread Stefan Behnel
Stefan Behnel added the comment: I'm also against changing re.compile() to not compile. And I often write code like this: replace_whitespace = re.compile(r"\s+").sub which is not covered by your current proposed change. -

[issue30576] http.server should support HTTP compression (gzip)

2017-09-27 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, both the feature and the PR look ok to me. Code formatting is a little funny at times, but the implementation looks good. -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue30

[issue30576] http.server should support HTTP compression (gzip)

2017-09-27 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: -scoder ___ Python tracker <https://bugs.python.org/issue30576> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-28 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +haypo ___ Python tracker <https://bugs.python.org/issue31465> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
New submission from Stefan Behnel : * Allow whitespace around predicate parts, i.e. "[a = 'text']" instead of requiring the less readable "[a='text']". * Add support for text comparison of the current node, like "[.='text']"

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +3816 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31648> ___ ___ Py

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: Well, there's XPath for a standard: https://www.w3.org/TR/xpath/ ElementPath deviates from it in its namespace syntax (it allows "{ns}tag" where XPath requires "p:tag" prefixes), but that's about it. All other differences are bas

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for noticing. I added a test and fixed it. -- ___ Python tracker <https://bugs.python.org/issue31648> ___ ___ Python-bug

[issue31336] Speed up _PyType_Lookup() for class creation

2017-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the reviews, and thank you for merging it, Serhiy. -- ___ Python tracker <https://bugs.python.org/issue31336> ___ ___

[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-10-13 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +3968 ___ Python tracker <https://bugs.python.org/issue31455> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-10-13 Thread Stefan Behnel
Stefan Behnel added the comment: Backport PR for 2.7 added: 3992 -- ___ Python tracker <https://bugs.python.org/issue31455> ___ ___ Python-bugs-list mailin

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-10-20 Thread Stefan Behnel
Stefan Behnel added the comment: Would it be possible to define Py_tss_NEEDS_INIT as a constant variable instead of a static initialiser? That would enable its use also for non-static initialisations. -- nosy: +scoder ___ Python tracker <ht

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-10-20 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +4029 ___ Python tracker <https://bugs.python.org/issue25658> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-10-20 Thread Stefan Behnel
Stefan Behnel added the comment: It seems that there's a simpler way that uses a cast on the literal. I added a pull request. Looks simple enough to not merit its own ticket, I think. -- ___ Python tracker <https://bugs.python.org/is

[issue31828] Support Py_tss_NEEDS_INIT outside of static initialisation

2017-10-20 Thread Stefan Behnel
New submission from Stefan Behnel : Following up on issue 25658, it was found that the current definition of Py_tss_NEEDS_INIT restricts its use to initialisers in C and cannot be used for arbitrary assignments. It is currently declared as follows: #define Py_tss_NEEDS_INIT {0} which

[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-10-20 Thread Stefan Behnel
Stefan Behnel added the comment: Seems like this isn't trivial, so I created a new ticket for this. See issue 31828. -- ___ Python tracker <https://bugs.python.org/is

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Stefan Behnel
Stefan Behnel added the comment: Seems ok from Cython side. Could be a bit difficult to make an actual use of this, but at least it shouldn't break anything. And it's a reasonable constraint to enforce. -- ___ Python track

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Stefan Behnel
Stefan Behnel added the comment: I also consider it an actual feature of ElementTree to allow arbitrary objects as its tags, even if it's not one of the most prominent. lxml cannot copy this because it is based on C libraries internally, but that shouldn't prevent ET from allowin

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Stefan Behnel
Stefan Behnel added the comment: >That said, I personally question the implementation decision to >represent things like treating comments as an Element with a tag of a >Comment function. This is not going to change. -- ___ Python tracke

[issue33561] Add .tostring() method to xml.etree.ElementTree.Element

2018-05-17 Thread Stefan Behnel
Stefan Behnel added the comment: Sorry, but you are proposing an API extension here that provides no benefits but duplicates existing functionality in a less versatile place. This is not going to happen. The second proposal (str(xml)) is actually not very helpful as it does not allow any

[issue19251] bitwise ops for bytes of equal length

2018-05-18 Thread Stefan Behnel
Stefan Behnel added the comment: I'd second the proposal of considering the "array.array" type for this, instead of the bytes/bytearray types. Why? Because it is somewhat of a niche case after all, and the bytes type seems too exposed for it. Also, array.array supports more di

[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-05-28 Thread Stefan Behnel
Stefan Behnel added the comment: Nice, I really like this. Apart from the usual bit of minor style issues, I couldn't see anything inherently wrong with the PR, but I'll leave the detailed reviews to those who'd have to maintain the code in the future. :) -

[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-05-28 Thread Stefan Behnel
Stefan Behnel added the comment: Regarding the benchmarks, just to be sure, did you try reversing the run order to make sure you don't get unfair caching effects for the later runs? -- ___ Python tracker <https://bugs.python.org/is

[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Stefan Behnel
Stefan Behnel added the comment: You misunderstood what the code is doing, and the response that you got indicates that the bug tracker is not the right place to discuss this misunderstanding. If you want to discuss this further, please ask on the Python mailing list (python-l...@python.org

[issue34068] Assertion failure in _PyType_Lookup

2018-07-08 Thread Stefan Behnel
Stefan Behnel added the comment: I added this assertion exactly for the purpose of finding this kind of bug. It means that some code tried to look up an attribute with a live exception set, which previously could swallow the exception in certain situations, and even if not, it is always the

[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: Nice! Patch looks good to me, minus the usual naming nit-pick. -- nosy: +scoder versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue34

[issue34160] ElementTree not preserving attribute order

2018-07-20 Thread Stefan Behnel
Stefan Behnel added the comment: At least for lxml, attributes were never specified to have a sorted order (although attribute dicts are sorted on *input*, to give a *predictable* order as in ET), and the tutorial says: "Attributes are just unordered name-value pairs". Howeve

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-28 Thread Stefan Behnel
Stefan Behnel added the comment: >> Commutativity guarantees can be delivered by sorting arguments before >> summation. > No thanks -- that's too expensive for such a small payoff. Since I don't really see people use this on vectors with hundreds of dimensions, l

[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Stefan Behnel
Stefan Behnel added the comment: Agree with Raymond. If the goal is to pass something else, then functions that want to make use of that "something else" have to be modified anyway, in which case also changing the call type wouldn't hurt (assuming the new value still fit

[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34309] Trouble when reloading extension modules.

2018-08-02 Thread Stefan Behnel
Stefan Behnel added the comment: a) Probably not something to fix in released versions any more, so increasing version from 3.5 to 3.8. b) Regarding shared library unloading and the problems mentioned, I'm also not sure if there is a way to safely unload transitively imported libraries

[issue32797] Tracebacks from Cython modules no longer work

2018-08-04 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, I can see that Cython is a special case because it can control the source line mapping and reporting through the C-API. Other code generators might not be able to do that, e.g. for a DSL or template language that gets translated to Python code, for

[issue32797] Tracebacks from Cython modules no longer work

2018-08-05 Thread Stefan Behnel
Stefan Behnel added the comment: > SageMath is the only project that I know which actually installs .pyx sources. Ah, right. I wrongly remembered that they are automatically included in binary packages, but that only applies to .py source of Cython compiled Python modules (which

[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Stefan Behnel
Stefan Behnel added the comment: Or, define a new "get_sourcemap()" method that could return additional metadata, e.g. a line number mapping. -- ___ Python tracker <https://bugs.python.o

[issue34376] Improve accuracy of math.hypot() and math.dist()

2018-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: Could we maybe make an educated guess based on absmin and absmax whether scaling is needed or not? -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34

[issue24076] sum() several times slower on Python 3 64-bit

2018-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, a PGO build of Py3.7 is now about 20% *faster* here than my Ubuntu 16/04 system Python 2.7, and for some (probably unrelated) reason, the system Python 3.5 is another 2% faster on my side. IMHO, the only other thing that seems obvious to try would be

[issue14886] json C vs pure-python implementation difference

2018-08-17 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, the C implementation of the sequence encoder uses PySequence_Fast(), so adding a lower priority instance check that calls the same encoding function would solve this. https://github.com/python/cpython/blob/cfa797c0681b7fef47cf93955fd06b54ddd09a7f

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2018-08-17 Thread Stefan Behnel
Stefan Behnel added the comment: > Serialization of ElementTree in the stdlib is much slower than in lxml (see > issue25881). Perhaps it should be implemented in C. But it should be kept > simple for this. Should I say it? That's a first class use case for Cython. > Prett

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-08-23 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: +Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue33187> ___ ___ Python-bug

[issue34461] Availability of parsers in etree initializer

2018-08-24 Thread Stefan Behnel
Stefan Behnel added the comment: The normal way to use ElementTree is to import the ElementTree module from the xml.etree package. Why do you think that needs to change? And why do you want to enforce an import of all modules before you even know which of them the users actually wants

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: I think the best work-around for now is to implement a bit of PEP 489, including a module create function that always returns the same static module reference instead of creating a new one after the first call, and a module exec function that simply returns

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: Well, first of all, it's better than a crash. :) Secondly, I'm sure NumPy doesn't currently support subinterpreters, just like most other extension modules. If I'm not mistaken, an interpreter switch can be detected through the interpre

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: FYI, I've updated Cython's module import checks to include an interpreter check. This (multi-file) test shows the new behaviour, which is to raise an ImportError on module creation when it detects a different interpreter than during the init

[issue34570] Segmentation fault in _PyType_Lookup

2018-09-03 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the report. Is the place where it crashes always the same? Could it be that your system is running out of resources, e.g. RAM? -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-08 Thread Stefan Behnel
Stefan Behnel added the comment: There are dedicated handler methods that you can implement: "def comment(self, comment)" and "def pi(self, target, data)". Both (c)ElementTree and lxml support those. I think the "target" argument to the parser is a bit unde

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: lxml supports "comment" and "pi" as event types in iterparse (or, more specifically, in the XMLPullParser). If someone wants to implement this for (c)ElementTree, I'd be happy to review the PR. https://lxml.de/api/lxml.etree

[issue34739] Get rid of tp_getattro in xml.etree.ElementTree.XMLParser

2018-09-19 Thread Stefan Behnel
Stefan Behnel added the comment: Nice. Looks good to me. -- ___ Python tracker <https://bugs.python.org/issue34739> ___ ___ Python-bugs-list mailing list Unsub

[issue34762] Change contextvars C API to use PyObject

2018-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > because Py_buffer isn't a PyObject at all :) It owns a PyObject reference to the buffer owner, though. -- nosy: +scoder ___ Python tracker <https://bugs.python.org

[issue34776] Postponed annotations break inspection of dataclasses

2018-09-27 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    2   3   4   5   6   7   8   9   10   11   >