[issue2799] Remove PyUnicode_AsString(), rework PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2008-06-06 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: While PyUnicode_AsStringAndSize() may be a better solution if the length is required, PyUnicode_AsString is enough() when it is not required. So I don't buy that argument. Since there are dedicated UTF-8 encoding functions, both fu

[issue2997] PyNumberMethods has left-over fields in Py3

2008-06-06 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: I would accept that if this had been done in all cases, but as I wrote in my first comment, the previously existing slot "nb_divide", which comes *before* the named ones, has already been removed, so there is no way existing P

[issue1185] py3k: Completely remove nb_coerce slot

2008-06-06 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: As noted in issue2997, the nb_divide slot (4th field!) has already been removed, so Py2 code has to be adapted anyway. I therefore recommend to just remove all unused fields to get a clean struct for Py3. -- nosy: +

[issue2997] PyNumberMethods has left-over fields in Py3

2008-06-10 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: The change that removed the nb_divide and nb_inplace_divide members is here: http://svn.python.org/view?rev=43285&view=rev http://svn.python.org/view/python/branches/p3yk/Include/object.h?rev=43285&view=diff&r1=43285&r

[issue3171] operator.*slice() should be deprecated in 2.6

2008-06-21 Thread Stefan Behnel
New submission from Stefan Behnel <[EMAIL PROTECTED]>: operator.delslice() and friends were removed in Python 3.0, as the underlying object methods no longer exist. In the same way that the slicing special methods were deprecated in favour of the item methods should the functions in the op

[issue3443] crash on badly initialised AttributeError

2008-07-25 Thread Stefan Behnel
New submission from Stefan Behnel <[EMAIL PROTECTED]>: I get a reproducible crash under Linux when running the test cases of lxml's trunk in Py3b2. As usual with these things, it's not reproducible when running the crashing test by itself, only when it hits the test during th

[issue3443] crash on badly initialised AttributeError

2008-07-27 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: Thanks a lot for the analysis. I was considering that this was a problem with Cython, but since this was the first time I got a crash on this (even Py3.0b1 didn't expose this), I wanted to ask here first. Your explanation soun

[issue2394] [Py3k] Finish the memoryview object implementation

2008-07-29 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: Also, the implementation does not follow the revised buffer PEP 3118. It still calls get/releasebuffer(NULL) to acquire a lock, which is no longer allowed by the buffer protocol. I think this should become a release blocker for the las

[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-01-30 Thread Stefan Behnel
Stefan Behnel added the comment: Looks like this is one of those bugs that run away when you look too close... I can get it to crash reliably for me with the latest py3k branch (and all Python 3.x release versions) when I run the test suite completely, so here's a new recipe. The inte

[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-01-31 Thread Stefan Behnel
Stefan Behnel added the comment: I'll add a couple of comments about the relevant parts of the code that appears to trigger the crash. The code runs through the parse tree and applies transformations to it. 1) For node matching, we use a dispatcher (in Visitor.py) that looks up methods

[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-02-15 Thread Stefan Behnel
Stefan Behnel added the comment: I tried several times to debug it myself, but I don't understand the exception cleanup macros in ceval.c (UNWIND_EXCEPTION_HANDLER and friends, new in Py3). If someone can get me set up to debug them, I can give it another shot. I assume there are a coup

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-02 Thread Stefan Behnel
New submission from Stefan Behnel : The xml.etree.ElementTree package in the Python 3.x standard library breaks compatibility with existing ET 1.2 code. The serialiser returns a unicode string when no encoding is passed. Previously, the serialiser was guaranteed to return a byte string. By

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-03 Thread Stefan Behnel
Stefan Behnel added the comment: I agree that the lxml API is somewhat clumsy here. I just mentioned it to show that there are already ways to do it in a backwards compatible way, so this change does two things: it breaks existing code, and it does so in a way that is incompatible with other

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-07 Thread Stefan Behnel
Stefan Behnel added the comment: It has been brought up several times that ET is special in the stdlib in that it is an externally maintained package. Correct me if I'm wrong, but the rules seem to be: features come outside, adaptation to Py3 can happen inside. What we are talking about

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-08 Thread Stefan Behnel
Stefan Behnel added the comment: Antoine, in the same comment, you say that it was not backported to Py2 in order to prevent breaking existing code, and then you ask if it's difficult to support in lxml. ;-) Supporting the same behaviour in lxml would either mean that it breaks exi

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-11 Thread Stefan Behnel
Stefan Behnel added the comment: Sorry, Antoine, but you can't possibly mean what you say here. The culprit in question is clearly one of the best hidden features of the new Py3 ET API. The only existing reference to it that I can find is the SVN commit comment when it was applied. H

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-11 Thread Stefan Behnel
Stefan Behnel added the comment: Then I would call that a clear sign that no-one actually stumbled over this feature in Py3 before I did, well hidden as it was. Still time to fix it. -- ___ Python tracker <http://bugs.python.org/issue8

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-11 Thread Stefan Behnel
Stefan Behnel added the comment: Hi Guido, your comment was long overdue in this discussion. Guido van Rossum, 12.03.2010 01:35: > My thinking was that since an XML document looks like text, it should > probably be considered text, at least by default. (There may have > been some

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-11 Thread Stefan Behnel
Stefan Behnel added the comment: One more thing: given that many web-frameworks are still not available for Py3 at this time, and that there are still tons of third-party libraries missing on that platform, I would be surprised if there was any ElementTree based XML/HTML processing code

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-12 Thread Stefan Behnel
Stefan Behnel added the comment: "'None' has always been the documented default for the encoding parameter" What I meant here was that "help(ET.tostring)" will show you that as the default. Also, in the docs, the signature is "tostring(tree, encoding=None)&q

[issue8130] except-as in Py3 eats variables

2010-03-12 Thread Stefan Behnel
New submission from Stefan Behnel : Python 3.2a0 (py3k:78205M, Feb 16 2010, 17:32:08) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> e = None [50279 refs] >>> e [50279 refs] >>>

[issue8130] except-as in Py3 eats variables

2010-03-12 Thread Stefan Behnel
Stefan Behnel added the comment: I knew that the variable was supposed to go out of scope when leaving the except block, but I wasn't aware that this was supposed to be done using (the equivalent of) a 'del'. Were the side-effects of deleting variables defined outside of

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-14 Thread Stefan Behnel
Stefan Behnel added the comment: That's a funny idea. I like that. +1 -- ___ Python tracker <http://bugs.python.org/issue8047> ___ ___ Python-bugs-list m

[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

2010-03-22 Thread Stefan Behnel
Stefan Behnel added the comment: > Supporting unicode for lxml.etree compatibility is fine with me, but I > think it might make sense to support the string "unicode" as well (as > a pseudo-encoding -- it's pretty clear to me that nobody will ever > define a real c

[issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser

2010-05-02 Thread Stefan Behnel
Stefan Behnel added the comment: There is at least one valid use case: code that needs to deal with HTML and XHTML currently has to normalise the tag names in some way, which usually means that it will want to remove the namespaces from XHTML documents to make it look like plain HTML. It

[issue4244] ihooks incompatible with absolute_import feature

2008-11-10 Thread Stefan Behnel
Stefan Behnel <[EMAIL PROTECTED]> added the comment: This is an (extended) duplicate of issue4152. -- nosy: +scoder ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4242] Classify language vs. impl-detail tests, step 1

2009-01-20 Thread Stefan Behnel
Stefan Behnel added the comment: I would definitely appreciate having a well-defined set of "required tests" that Cython should pass for compliance. However, something like sys.vm won't easily work for Cython: it runs within the CPython VM but only after converting the P

[issue4242] Classify language vs. impl-detail tests, step 1

2009-01-20 Thread Stefan Behnel
Stefan Behnel added the comment: @Antoine: Cython already compiles a major part of CPython's test suite successfully (although we didn't actually try to compile the stdlib itself but only the tests). It's an announced goal for Cython 1.0 to compile 'all' Python code,

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

2019-08-23 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset b5d3ceea48c181b3e2c6c67424317afed606bd39 by Stefan Behnel in branch 'master': bpo-14465: Add an indent() function to xml.etree.ElementTree to pretty-print XML trees (GH-15200) https://github.com/python/cpyt

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

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

[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-24 Thread Stefan Behnel
Stefan Behnel added the comment: Sounds like a good idea to add something like this. Have a look here for some more ideas: https://github.com/lxml/lxml/blob/master/tools/xpathgrep.py ElementTree should be able to provide most of these features as well these days. -- stage: -> ne

[issue23423] XPath Support in ElementTree doc omission

2019-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: Already fixed in later versions of the documentation: https://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax Note that Py3.4 is no longer maintained. -- resolution: -> out of date stage: -> resolved status

[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: I agree that formatting is not a use case by itself. I like the idea of XPath grepping, though, especially *without* pretty printing, i.e. one result per line. I admit that there is no strong reason for adding such a command line tool to the stdlib, though

[issue38011] xml.dom.pulldom splits text data at buffer size when parsing from file

2019-09-02 Thread Stefan Behnel
Stefan Behnel added the comment: I don't see anything inherently wrong with having multiple text nodes. In fact, input with very large text content can be considered a security threat (c.f. compression bombs), so a tool like pulldom (which is designed for incremental processing) shoul

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-09-10 Thread Stefan Behnel
Stefan Behnel added the comment: Let's just deprecate it directly (in Py3.9, I guess), given that it was never documented. -- ___ Python tracker <https://bugs.python.org/is

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

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

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-09-10 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 7d952ded6813c896ea3f4234bb8db5247dcb5484 by Stefan Behnel (Gordon P. Hemsley) in branch 'master': bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy() (GH-12995) https://github.com/python/cpyt

[issue10108] ExpatError not property wrapped

2019-09-10 Thread Stefan Behnel
Stefan Behnel added the comment: I agree that it's surprising to get a low-level parser error from a high-level library like xmlrpc. I think this can be changed without deprecation, because users must expect exceptions from the xmlrpc library in any case. Targeting to Py3.9, needs

[issue28237] In xml.etree.ElementTree bytes tag or attributes raises on serialization

2019-09-10 Thread Stefan Behnel
Stefan Behnel added the comment: Arguably, writing out "b'x'" as attribute name instead of raising an exception isn't ideal. However, OTOH, I think it's reasonable to accept anything that is serialisable as a string, not just strings. That makes it difficult

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: +Python 3.9 -Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue33187> ___ ___ Python-bug

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: -Python 3.7 ___ Python tracker <https://bugs.python.org/issue33187> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 97b817eae34b77be1ced382e15098a112f547848 by Stefan Behnel (Anjali Bansal) in branch 'master': bpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861) https://github.com/python/cpyt

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 6cf0ba8a632b1c0bd3576ed33c971ca3778000de by Stefan Behnel (Miss Islington (bot)) in branch '3.8': bpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861) (GH-15958) https://github.com/python/cpyt

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue33187> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2019-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 195dc142f84804ad9c8ce91414ab4a0bf9615f09 by Stefan Behnel (Miss Islington (bot)) in branch '3.7': bpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861) (GH-15972) https://github.com/python/cpyt

[issue38158] PyType_Spec docs list non-existant field "doc"

2019-09-13 Thread Stefan Behnel
New submission from Stefan Behnel : The current documentation of the PyType_Spec struct lists a "doc" member which does not exist. It should be removed from the docs. https://docs.python.org/3.8/c-api/type.html#c.PyType_Spec -- assignee: docs@python components: Documentatio

[issue38158] PyType_Spec docs list non-existant field "doc"

2019-09-13 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: -> needs patch ___ Python tracker <https://bugs.python.org/issue38158> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38158] PyType_Spec docs list non-existant field "doc"

2019-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: Absolutely, Tahia. It just needs a PR with a doc update. -- ___ Python tracker <https://bugs.python.org/issue38158> ___ ___

[issue38160] Add a "PyInterpreterState *" field to PyTypeObject.

2019-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: I think access to the global module state is the most critical for an extension, probably by far. A direct pointer to the interpreter state from every type feels like an optimisation that may be premature at this point. Modules should have that reference

[issue38158] PyType_Spec docs list non-existant field "doc"

2019-09-15 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset b65be6cd3d9b6102227d27f4f35385f999a7dd7d by Stefan Behnel (Miss Islington (bot)) in branch '3.8': bpo-38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142) (GH-16154) https://github.com/p

[issue38158] PyType_Spec docs list non-existant field "doc"

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

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-19 Thread Stefan Behnel
Stefan Behnel added the comment: My usual first reaction is: "if you need to find out whether the return value of a callable will be an Awaitable or not, without calling it, then you're probably doing something wrong in your design". However, a) there is code that tries this

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2019-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > along with the appropriate CO_COROUTINE flag set No, it never did that, for safety reasons. It's difficult to say if enabling these flags is the right thing to do, because it's unclear what assumptions code that tests for them would make. In C

[issue33187] Document ElementInclude (XInclude) support in ElementTree

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

[issue43616] random.shuffle() crashes with Unhandled exception

2021-03-25 Thread Stefan Behnel
Stefan Behnel added the comment: Almost certainly not a bug in CPython's stdlib. Possibly something worth investigating in lxml, although, as stated in issue 43618, random.shuffle() simply does not work on lxml.etree Elements. -- resolution: -> third party stage: -&g

[issue43618] random.shuffle loses most of the elements

2021-03-25 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, this is neither a bug in CPython (or its stdlib) nor in lxml. It's how things work. Don't use these two together. -- resolution: -> third party stage: -> resolved status: open -> closed ___

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: These macros are a sort-of documented part of the C-API. At least, they were mentioned in a What's New document: https://docs.python.org/3/whatsnew/2.7.html?highlight=py_isspace#build-and-c-api-changes They were added here, for the Py2.7 release:

[issue40066] Enum: modify __repr__, __str__; update docs

2021-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: > why /shouldn't/ we make the change? It breaks doctests, and probably some other unit tests, too, e.g. for output formatting. What should we suggest users to do? Replace >>> get_flag(…) by >>> get_flag(…) == app_enu

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread Stefan Behnel
Stefan Behnel added the comment: The macros were moved to "Includes/cpython/", not to "Includes/internal/". That suggests to me that they should use "extern C", so that C++ code that wants to make use of CPython internals can use them. Basically, the way I

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2021-04-17 Thread Stefan Behnel
Stefan Behnel added the comment: I support that there should be a simple way to do this from C. The way via importing the "gc" module and then looking up an attribute (possibly building a Unicode string) and calling a function in it involves several operations that can take som

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2021-04-20 Thread Stefan Behnel
Stefan Behnel added the comment: Coming back to this after a while. I would like to get rid of the work-around (read: huge hack) that we have in Cython for this check and thus would ask for the check to be removed in Py3.10. According to the discussion, no-one seemed to remember why it was

[issue43959] Improve documentation of PyContextVar C-API

2021-04-27 Thread Stefan Behnel
New submission from Stefan Behnel : The documentation of the PyContextVar C-API is unclear in a couple of places. - It's not clear whether PyContextVar_Get() always returns an owned reference also for default values or only if a value was found. - It's not explicit that "opt

[issue43959] Improve documentation of PyContextVar C-API

2021-04-27 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +24362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25671 ___ Python tracker <https://bugs.python.org/issu

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2021-04-28 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder nosy_count: 3.0 -> 4.0 pull_requests: +24377 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25687 ___ Python tracker <https://bugs.python.org/i

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2021-04-28 Thread Stefan Behnel
Stefan Behnel added the comment: I just remembered that it's usually helpful to return the previous state, so that callers know whether they need to re-enable or disable the GC when they're done. I'll add that. Also, returning an "int" may allow us to add a &quo

[issue43959] Improve documentation of PyContextVar C-API

2021-04-28 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset fdb11897d7c8f9e6bdf96fcef802f784ef90f726 by Miss Islington (bot) in branch '3.9': bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) (GH-25689) https://github.com/python/cpyt

[issue43959] Improve documentation of PyContextVar C-API

2021-04-28 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset ff7266efd0ef6b42dad30c9c0d210f843cc44f39 by Miss Islington (bot) in branch '3.8': bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) (GH-25690) https://github.com/python/cpyt

[issue43959] Improve documentation of PyContextVar C-API

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

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

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

[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel
New submission from Stefan Behnel : I'm not sure if I should consider this a bug, but I'd at least frown at the behaviour, so I thought I'd bring this up here. Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] on linux >>> 2**53 == float(2**53) True >>&

[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +tim.peters ___ Python tracker <https://bugs.python.org/issue44054> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44054] 2**53+1 != float(2**53+1)

2021-05-06 Thread Stefan Behnel
Stefan Behnel added the comment: > I really don't know why you would desire a different result. I found it surprising that a comparison uses a different method of conversion than the (obvious) user-side conversion, with a different outcome. This seems to be implementation details

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-11 Thread Stefan Behnel
Stefan Behnel added the comment: For the same reason that motivated this ticket, I think the functions should be inline functions. They should also take the current thread-state as argument, because that's probably known on the caller side already. I guess a macro would be fine

[issue40222] "Zero cost" exception handling

2021-05-11 Thread Stefan Behnel
Stefan Behnel added the comment: Just a comment regarding the change to "PyCode_NewWithPosOnlyArgs()". As Pablo mentioned, this has happened before. And that's OK! Exactly because this has happened before, it's clearly not a part of the API that is meant to be stable.

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: I just noticed that new C-API functions are probably useless for Cython since I think it will have to maintain the CFrame stack, so not to enable "use_tracing" for the (Python) caller but the current (Cython) function. This then means that we own T

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Stefan Behnel added the comment: Should we allow empty CFrame entries (with a NULL Frame pointer) that only use their "use_tracing" flag? That would make it easy for code to append and remove such an entry in order to temporarily disab

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-05-14 Thread Stefan Behnel
Change by Stefan Behnel : -- Removed message: https://bugs.python.org/msg393667 ___ Python tracker <https://bugs.python.org/issue43760> ___ ___ Python-bugs-list m

[issue43420] Optimize rational arithmetics

2021-05-17 Thread Stefan Behnel
Stefan Behnel added the comment: Just FYI, I applied the same changes to the quicktions [1] module, a Cython compiled (and optimised) version of fractions.Fraction. [1] https://github.com/scoder/quicktions/ The loss in performance for small values is much higher there, almost 2x for the

[issue19832] XML version is ignored

2021-06-18 Thread Stefan Behnel
Stefan Behnel added the comment: After reading up a bit, version "X" should probably be rejected, whereas "1.[0-9]+" is meant to be allowed also by a 1.0 parser, according to the spec: https://www.w3.org/TR/REC-xml/#sec-prolog-dtd """ When an XML 1.0 p

[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel
Stefan Behnel added the comment: Could you explain a bit why you want to subclass "PyModuleObject" in C? Why isn't a Python subclass or an independent (non-module) C extension type enough? -- ___ Python tracker <https://bugs.pyt

[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel
Change by Stefan Behnel : -- components: +C API -Interpreter Core type: -> enhancement versions: +Python 3.11 -Python 3.5 ___ Python tracker <https://bugs.python.org/issu

[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel
Stefan Behnel added the comment: I only just noticed that the original request is from 2015. My guess is that this is a resolved problem, given the available options. I'll close this ticket as outdated. Please comment if this is still an issue. -- resolution: -> out of da

[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2021-07-19 Thread Stefan Behnel
Stefan Behnel added the comment: The obvious work-around is to not use a default namespace. The result is just a visual difference, not a semantic one. If someone wants to continue with the existing PR, I'll try to free some time to review any improvements. -- versions: +P

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

2021-09-20 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +26868 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28469 ___ Python tracker <https://bugs.python.org/issu

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

2021-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: I created a PR from my last patch, inlining the unpacking of single digit integers. Since most integers should fit into a single digit these days, this is as fast a path as it gets. https://github.com/python/cpython/pull/28469 -- versions: +Python

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: > The code in the examples given above are using `tstate->use_tracing` assuming > that its meaning is to determine whether tracing is turned on or not. No, actually not. It is using the field in the same way as CPython, simply because most of this

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

2021-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: > The patch looks fine, but it looks a bit like benchmark chasing. Is the speed > of builtin sum() of a sequence of integers important enough to do this bit of > inlining? Given that we already accepted essentially separate loops for the int, f

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

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset debd80403721b00423680328d6adf160a28fbff4 by scoder in branch 'main': bpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469) https://github.com/python/cpython/commit/debd80403721b00423680328d6adf1

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

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, best of 5: 1

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

2021-09-21 Thread Stefan Behnel
Change by Stefan Behnel : -- Removed message: https://bugs.python.org/msg402301 ___ Python tracker <https://bugs.python.org/issue24076> ___ ___ Python-bugs-list m

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

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, best of 5: 1

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

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, thanks for insisting, Serhiy. I was accidentally using a debug build this time. I'll make a PGO build and rerun the microbenchmarks. -- ___ Python tracker <https://bugs.python.org/is

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

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Old, with PGO: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 1000 loops, best of 5: 340 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, be

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

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

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

2021-09-22 Thread Stefan Behnel
Stefan Behnel added the comment: Sorry for that, Pablo. I knew exactly where the problem was, the second I read your notification. Thank you for resolving it so quickly. -- ___ Python tracker <https://bugs.python.org/issue24

[issue38742] ElementTree won't parse comments before root element

2019-11-15 Thread Stefan Behnel
Stefan Behnel added the comment: Duplicate of issue 9521 (and issue 24287). -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> xml.etree.ElementTree skips processing instructions when parsing ___ Py

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

2019-11-25 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset c6a7bdb356835c9d7513b1ea6846683d446fe6c3 by Stefan Behnel in branch 'master': bpo-20928: support base-URL and recursive includes in etree.ElementInclude (#5723) https://github.com/python/cpython/commit/c6a7bdb356835c9d7513b1ea684668

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

2019-11-25 Thread Stefan Behnel
Stefan Behnel added the comment: I think setting "xml:base" from ElementInclude is worth another ticket. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.8 ___ Pyt

[issue38910] AssertionError: ElementTree not initialized, missing root

2019-11-26 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Agreed that both should behave the same. And, we should finally decide whether this should really be changed or not. The current behaviour is counter-intuitive, but it's been like that forever and lots of code depends on it in one way or anothe

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