Change by Stefan Behnel :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
Change by Stefan Behnel :
--
keywords: +patch
pull_requests: +13024
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36811>
___
___
Py
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
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
Stefan Behnel added the comment:
Looks like the issue was originally reported against Python 3.4.
--
___
Python tracker
<https://bugs.python.org/issue25
Change by Stefan Behnel :
--
nosy: -scoder
___
Python tracker
<https://bugs.python.org/issue25541>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Change by Stefan Behnel :
--
keywords: +patch
pull_requests: +13112
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
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
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
Change by Stefan Behnel :
--
stage: needs patch -> resolved
___
Python tracker
<https://bugs.python.org/issue36831>
___
___
Python-bugs-list mailing list
Un
Change by Stefan Behnel :
--
pull_requests: +13136
___
Python tracker
<https://bugs.python.org/issue36676>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Change by Stefan Behnel :
--
keywords: +patch
pull_requests: +13154
___
Python tracker
<https://bugs.python.org/issue36885>
___
___
Python-bugs-list mailin
Change by Stefan Behnel :
--
title: Clean up makeunicode.py script -> Make makeunicode.py script more
readable
___
Python tracker
<https://bugs.python.org/issu
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
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
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
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
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
Change by Stefan Behnel :
--
pull_requests: +5508
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue20928>
___
___
Python-bugs-list mai
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
Change by Stefan Behnel :
--
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue32388>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stefan Behnel :
--
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue32387>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stefan Behnel :
--
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue32856>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Change by Stefan Behnel :
--
components: +Extension Modules
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue32973>
___
___
Python-bugs-list mailin
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
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
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
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
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
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 #
Stefan Behnel added the comment:
PR is complete now, ready for merging.
--
___
Python tracker
<https://bugs.python.org/issue20928>
___
___
Python-bugs-list mailin
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
Change by Stefan Behnel :
--
pull_requests: +6034
stage: resolved -> patch review
___
Python tracker
<https://bugs.python.org/issue31455>
___
___
Python-
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
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.
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
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
Stefan Behnel added the comment:
Any comments on this?
--
___
Python tracker
<https://bugs.python.org/issue31465>
___
___
Python-bugs-list mailing list
Unsub
Stefan Behnel added the comment:
Still ready for merging :)
--
___
Python tracker
<https://bugs.python.org/issue31336>
___
___
Python-bugs-list mailing list
Unsub
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.
-
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
Change by Stefan Behnel :
--
nosy: -scoder
___
Python tracker
<https://bugs.python.org/issue30576>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stefan Behnel :
--
nosy: +haypo
___
Python tracker
<https://bugs.python.org/issue31465>
___
___
Python-bugs-list mailing list
Unsubscribe:
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']"
Change by Stefan Behnel :
--
keywords: +patch
pull_requests: +3816
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31648>
___
___
Py
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
Stefan Behnel added the comment:
Thanks for noticing. I added a test and fixed it.
--
___
Python tracker
<https://bugs.python.org/issue31648>
___
___
Python-bug
Stefan Behnel added the comment:
Thanks for the reviews, and thank you for merging it, Serhiy.
--
___
Python tracker
<https://bugs.python.org/issue31336>
___
___
Change by Stefan Behnel :
--
pull_requests: +3968
___
Python tracker
<https://bugs.python.org/issue31455>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Behnel added the comment:
Backport PR for 2.7 added: 3992
--
___
Python tracker
<https://bugs.python.org/issue31455>
___
___
Python-bugs-list mailin
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
Change by Stefan Behnel :
--
pull_requests: +4029
___
Python tracker
<https://bugs.python.org/issue25658>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
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. :)
-
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
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
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
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
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
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
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
Change by Stefan Behnel :
--
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue34309>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Stefan Behnel added the comment:
Nice. Looks good to me.
--
___
Python tracker
<https://bugs.python.org/issue34739>
___
___
Python-bugs-list mailing list
Unsub
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
Change by Stefan Behnel :
--
nosy: +scoder
___
Python tracker
<https://bugs.python.org/issue34776>
___
___
Python-bugs-list mailing list
Unsubscribe:
601 - 700 of 1287 matches
Mail list logo