Eli Bendersky added the comment:
Florent, thanks for the patch - at this point code is more useful than talk :-)
Anyhow, I tried to apply it and a few tests in test_xml_etree_c fail, because
it can't find fromstring and fromstringlist. This gets fixed when I import
fromstringli
Eli Bendersky added the comment:
> I strongly feel that existing code importing ElementTree or cElementTree
> should not be broken. Let’s add transparent import from _elementtree to
> ElementTree without breaking existing uses of cET.
>
AFAICS there's currently no disagreem
Eli Bendersky added the comment:
The more I think about it, the more the bootstrap code in _elementtree.c annoys
me. It's the only instance of calling PyRun_String in Modules/ !
It's hackish and causes ugly import problems. If the C code needs stdlib
functionality like copy.de
Eli Bendersky added the comment:
>> I find it perfectly legitimate to run Python code from a C module.
Certainly not a hack. We all know that most non-trivial functionality can
be expressed much easier in Python than in C, that's why we use Python
after all. In particular, defining a
Eli Bendersky added the comment:
Another random cleanup idea:
ElementTree.py has this code:
try:
from . import ElementPath
except ImportError:
ElementPath = _SimpleElementPath()
Since in the stdlib ElementPath.py is always there, this is meaningless, so I'd
say this try... e
Eli Bendersky added the comment:
>> I was referring to one of the points raised in the email thread: the docs
>> don’t tell people that they can import a faster ET version, cET.
Well, they *do*, but very modestly :-) I agree that should be improved and
emphasized a bit,
Eli Bendersky added the comment:
Florent,
The issue13988_fold_cET_behind_ET.diff patch looks good to me. Unless there are
objections from others, you can commit! Even the tests became simpler now,
that's awesome ;-)
Now, what's left for this issue:
1. Update the documentation
Eli Bendersky added the comment:
Attaching a patch for Doc/library/xml.etree.elementtree.rst and Misc/NEWS.
The doc notice is modeled after a similar notice in the doc of 'pickle'. Note
that I've also removed the mention that effbot's site is the home of the
develo
Eli Bendersky added the comment:
Florent,
Just something minor I noticed in the new cElementTree.py:
# Wrapper module for _elementtree
from xml.etree.ElementTree import *
# Not in __all__
from xml.etree.ElementTree import ElementPath, XMLID, register_namespace
The "wrapper&quo
Eli Bendersky added the comment:
Would not adding a new keyword arg to open() be less intrusive and more
consistent?
I.e. open(fname, asciionly=True) or something similar.
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.
Eli Bendersky added the comment:
Éric,
Could you please open a new issue (with a dependency on this one) and explain
there clearly what you want/mean?
--
___
Python tracker
<http://bugs.python.org/issue13
Eli Bendersky added the comment:
If the concept is accepted. I see no better place for this than the
Unicode HOWTO. If it's too long, then a TL;DR; section should be added
in the beginning detailing "the bare minimum". No need to scatter such
information in bits and pi
Eli Bendersky added the comment:
Florent,
Your updated patch looks good. I think that the explicit import of
_namespace_map into cElementTree is just to satisfy some weird magic in the
tests and can probably be removed as well (along with the weird magic :-), but
that's not really impo
Eli Bendersky added the comment:
By the way, I see that if the explicit import of _namespace_map is commented
out, the test_xml_etree_c test fails because it's not in the __all__ list. So
the test can just import it directly with:
from xml.etree.ElementTree import _namespace_map
An
Eli Bendersky added the comment:
>> OK, so if I got it correctly, I should document
>> multiprocessing.queue.SimpleQueue in 2.7 and 3.1 [...]
and 3.2, we're no longer updating 3.1 with such changes
--
___
Python tracker
<ht
Changes by Eli Bendersky :
--
Removed message: http://bugs.python.org/msg153224
___
Python tracker
<http://bugs.python.org/issue11836>
___
___
Python-bugs-list m
Eli Bendersky added the comment:
> OK, so if I got it correctly, I should document
> multiprocessing.queue.SimpleQueue in 2.7 and 3.1 [...]
s/3.1/3.2/
--
___
Python tracker
<http://bugs.python.org/i
Eli Bendersky added the comment:
Alright, it's not really important at this point and can be cleaned up
later.
>
> I will probably commit code and documentation at once. It makes things
> easier regarding traceability.
>
Sounds good
--
_
New submission from Eli Bendersky :
The documentation of xml.etree.ElementTree has to be improved. The first, very
obvious step, would be to start the documentation page with a general overview
of the module + some simple examples. The current opening section makes no
sense for this module
Eli Bendersky added the comment:
I would add to the TODO - improve the documentation of the module. Opened issue
14006 for this.
--
resolution: fixed ->
stage: committed/rejected -> needs patch
status: closed -> open
___
Python track
Changes by Eli Bendersky :
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eli Bendersky added the comment:
I started going over the deprecated methods in ElementTree and ran into a more
serious problem. XmlParser.doctype() is listed as deprecated, and indeed
ElementTree (the Python version) issues a deprecation warning. However, the C
implementation doesn't
New submission from Eli Bendersky :
Although documented, the C accelerator of xml.etree.ElementTree (used by
default since issue 13988) does not use or define the doctype() methods of the
XMLParser and TreeBuilder classes, although this method is documented.
As far as I can tell, this problem
Eli Bendersky added the comment:
The doctype() problem is deeper, since neither does TreeBuilder implement it
(although for this class it's not even deprecated). Since this appears to be a
problem in 3.2 as well, I'm opening a new issue - 14007, to
Changes by Eli Bendersky :
--
Removed message: http://bugs.python.org/msg153325
___
Python tracker
<http://bugs.python.org/issue13988>
___
___
Python-bugs-list m
New submission from Eli Bendersky :
The C accelerator of xml.etree.ElementTree (used by default since issue 13988)
does not use or define or use the doctype() methods of the XMLParser and
TreeBuilder classes, although this method is documented.
As far as I can tell, this problem exists in 3.2
Changes by Eli Bendersky :
--
Removed message: http://bugs.python.org/msg153327
___
Python tracker
<http://bugs.python.org/issue13988>
___
___
Python-bugs-list m
Eli Bendersky added the comment:
Opened issue 14007 to track the doctype() problem
--
___
Python tracker
<http://bugs.python.org/issue13988>
___
___
Python-bug
Eli Bendersky added the comment:
Opened issue 14007 to track the doctype() problem
--
___
Python tracker
<http://bugs.python.org/issue13988>
___
___
Python-bug
Changes by Eli Bendersky :
--
Removed message: http://bugs.python.org/msg153324
___
Python tracker
<http://bugs.python.org/issue14007>
___
___
Python-bugs-list m
Eli Bendersky added the comment:
The problem is deeper. _elementtree does not expose XMLParser and TreeBuilder
as types at all, just as factory functions.
XMLParser: not sure if it was meant to be subclassed. If not, it should at
least be documented. In any case, the XMLParser in
Eli Bendersky added the comment:
Emitting a deprecation warning on importing cElementTree has been rejected in
the pydev list. The other remaining tasks have new issues on them, so this
issue is done now.
--
___
Python tracker
<h
Eli Bendersky added the comment:
Éric, indeed it clarifies the usage, but my concern is that it also moves the
first mention of the module further down.
There's no real reason for someone using CPython 2.7 or 3.2 *not* to use cET.
So, some mention should appear in the opening paragraph
Eli Bendersky added the comment:
Also, I must add that I absolutely hate the opening paragraph of the
documentation in this module. Once 14006 is implemented, parts of it should be
backported to 2.7 and 3.2
That would be an orthogonal change to what we're discussion here, t
Changes by Eli Bendersky :
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.org/issue14023>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eli Bendersky added the comment:
If you want to collect additional feedback, you may want to add some other
people to the Nosy list :-) Alternatively, since it's a small doc change you
can just commit it and it can be fixed later if someone strongly objects.
>>>
This:
The :
Eli Bendersky added the comment:
Florent, I can reproduce the problem by leaving just the last
import_fresh_module in test_fresh_import.py
And your patch fixes it, although as Nick says it's problematic in terms of ref
leaks.
What I'm not sure about is why the extra reference is n
Eli Bendersky added the comment:
> > If you want to collect additional feedback, you may want to add some
> other
> > people to the Nosy list :-)
> I did not want more feedback, I wanted to leave time for interested
> parties to find this bug for themselves and eventual
Eli Bendersky added the comment:
Ezio, your fix for 8 is definitely good. Space makes it cleaner, as well as
compliant to PEP 8, which explicitly recommends to surround operators with
spaces.
Note, however, that this should be applied in other places as well, not only
the complex number
Eli Bendersky added the comment:
Comments on some of the suggestions:
1) Agreed
2) Can be combined with (3), I think. Just show the number example with the
explanatory comments. They speak for themselves. No need for the SPAM and
STRING assignments.
5) Yep. Can be replaced by "A value c
Eli Bendersky added the comment:
Regarding the use of the name "variable", could it be replaced by just "name" ?
That might make sense since the error for undefined "names" is usually
NameError. However, note that the current documentation has a /huge/ amount o
New submission from Eli Bendersky :
Element, XMLParser and TreeBuilder are types in ElementTree, but factory
functions in _elementtree. The latter should be modified to be consistent with
the former.
--
assignee: eli.bendersky
components: Library (Lib)
messages: 154317
nosy
Eli Bendersky added the comment:
In the pydev discussion once Martin raised this problem it was agreed that this
is a regression in 3.3 that should be fixed, since there is code out there that
relies on subclassing Element. This would make the Python and C implementations
of ET more
New submission from Eli Bendersky :
I'm now carefully reading through the "extending" documentation pages. This
issue will record various problems I find on the way, with the intention of
fixing them eventually.
--
assignee: eli.bendersky
components: Documentation
Eli Bendersky added the comment:
extending.html has a reference to "Demo/embed/demo.c" which no longer exists in
the source distribution
--
___
Python tracker
<http://bugs.python.o
Eli Bendersky added the comment:
Florent,
The deprecation should be probably raised separately on pydev. From the recent
discussions on this and similar topics, I doubt that removal of these methods
will be accepted.
--
___
Python tracker
<h
Eli Bendersky added the comment:
"in this case, nothing more than every Python object contains"
There's a grammar error lurking somewhere in there...
--
___
Python tracker
<http://bugs.pyt
Eli Bendersky added the comment:
"A PyObject is not a very magnificent object - it just contains the refcount
and a pointer to the object’s “type object”."
Too chatty and should be replaced by a more pragmatic explanation, or shortened.
--
nosy: +d
Eli Bendersky added the comment:
This is not strictly in the extending doc, but linked from it:
http://docs.python.org/dev/c-api/type.html#PyType_GenericNew
The PyType_GenericNew API function is not documented
--
___
Python tracker
<h
Eli Bendersky added the comment:
"Let’s expend "
Typo
--
___
Python tracker
<http://bugs.python.org/issue14129>
___
___
Python-bugs-list mailing
Eli Bendersky added the comment:
"The new method calls the tp_alloc slot to allocate memory"
tp_alloc needs formatting here, similarly to the way it's done in other places
--
___
Python tracker
<http://bugs.pyt
Eli Bendersky added the comment:
Noddy_name in the full code listing (included from noddy2.c) is different from
the Noddy_name that is actually explained later
--
___
Python tracker
<http://bugs.python.org/issue14
Eli Bendersky added the comment:
"but in this cased"
Typo
[this and the past couple of comments refer to the newtypes.html doc]
--
___
Python tracker
<http://bugs.python.o
Eli Bendersky added the comment:
On Sun, Feb 26, 2012 at 23:49, Florent Xicluna wrote:
Yes, these suggestions sound reasonable to me. Moving toward two more
consistent implementations of the API, while not disabling existing
features is the way to go. Things like relaxing the Python XMLParser
Eli Bendersky added the comment:
There are some:
"
XXX Need to ...
"
Paragraphs scattered across the doc. These have no place in the official
documentation. For placeholders, an issue can be created that lists all the
things that need
Eli Bendersky added the comment:
Adding the documentation experts.
I plan to apply a fix for these soon. If you guys have any objections, let me
know.
--
nosy: +eric.araujo, ezio.melotti, georg.brandl
___
Python tracker
<http://bugs.python.
Eli Bendersky added the comment:
Patch attached
--
keywords: +patch
stage: -> patch review
Added file: http://bugs.python.org/file24663/issue_14129.1.patch
___
Python tracker
<http://bugs.python.org/issu
Eli Bendersky added the comment:
Thanks for the review. I'm going to do the commit now. Feel free to just fix it
if any obvious mistakes remain.
--
___
Python tracker
<http://bugs.python.org/is
Eli Bendersky added the comment:
I'm attaching a patch for Doc/library/xml.dom.minidom.rst
It adds the note as phrased by Stefan, with a tiny wording change to make the
first sentence less ambiguous.
--
keywords: +patch
Added file: http://bugs.python.org/file24686/issue_11
Eli Bendersky added the comment:
>
> I’m not sure I would use note markup, though (cf. Raymond’s aversion to
> littering the doc with note and warning boxes).
>
I also dislike box littering, but this one seems like a really good fit for
a note, since it's completely outside
Eli Bendersky added the comment:
John, thanks for the contribution, however this is not a valid fix.
See the Wikipedia page for floating point:
http://en.wikipedia.org/wiki/Floating_point
No dash!
There is no need to go over the Python docs fixing such "mistakes". If you hav
Changes by Eli Bendersky :
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.org/issue14165>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eli Bendersky added the comment:
IMHO just leave it. The documentation is mainly for reference, i.e. describing
in the best way possible what's available *now*. If you want to mention an
upgrade path, write a blog :)
--
___
Python tracker
Eli Bendersky added the comment:
Committed to 2.7, 3.2 and 3.3
I suppose this issue can be closed now?
--
___
Python tracker
<http://bugs.python.org/issue11
Eli Bendersky added the comment:
Attaching a patch that exposes ET.Element as a type, instead of as a factory
function.
I'd really love to get a review for this, since I'm still relatively
inexperienced when it comes to writing C extension code.
--
keywords: +patch
Added
Changes by Eli Bendersky :
--
priority: -> normal
___
Python tracker
<http://bugs.python.org/issue13462>
___
___
Python-bugs-list mailing list
Unsubscri
Eli Bendersky added the comment:
Stefan, frankly I'm not familiar enough with either xml.dom or xml.dom.minidom
to have a solid opinion at this point.
--
___
Python tracker
<http://bugs.python.org/is
Eli Bendersky added the comment:
I can confirm that this indeed fails for the C implementation, while succeeding
for the Python implementation.
The C implementation doesn't appear to support extended slices for getting and
setting items. Looking in
Eli Bendersky added the comment:
Correction: extended slices are supported. The problem appears to be just with
'del', because element_ass_subscr doesn't treat it specially and thinks we just
want to assign a 0-len value to a
Changes by Eli Bendersky :
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.org/issue14065>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eli Bendersky added the comment:
I'll go on and commit this.
The test suite of ET is not bad and all tests keep passing. Stylistic issues
and best practices can be fixed later.
I want to have other work done on _elementtree, and having several patches to
the same source file is
Eli Bendersky added the comment:
Éric,
The tests *do* use import_fresh_module, actually. Moreover, while
monkeypatching exists it's rather limited (just setting the module name for
test_main).
The biggest problem with these tests is that they're based on doctest, which
wasn
Eli Bendersky added the comment:
Éric,
The tests *do* use import_fresh_module, actually. Moreover, while
monkeypatching exists it's rather limited (just setting the module name for
test_main).
The biggest problem with these tests is that they're based on doctest, which
wasn
Changes by Eli Bendersky :
--
Removed message: http://bugs.python.org/msg154883
___
Python tracker
<http://bugs.python.org/issue14128>
___
___
Python-bugs-list m
Changes by Eli Bendersky :
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.org/issue14190>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eli Bendersky added the comment:
Éric, go ahead :)
--
___
Python tracker
<http://bugs.python.org/issue1040439>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eli Bendersky :
--
keywords: +easy
versions: +Python 3.2, Python 3.3
___
Python tracker
<http://bugs.python.org/issue14190>
___
___
Python-bugs-list m
New submission from Eli Bendersky :
http://docs.python.org/dev/library/xml.dom.pulldom.html
"embarrassing" is the word I wanted to use, but it's too strong for the title
;-)
Seriously, this module is part of the stdlib, it should at least have *some*
documentation.
--
Eli Bendersky added the comment:
Attaching a patch that fixes the slice deletion problems.
The approach I've taken is follow a similar implementation in
Objects/listobject.c; when a slice is deleted, it can be done efficiently by
using memmove to shift whole blocks of leftover chi
Changes by Eli Bendersky :
--
assignee: -> eli.bendersky
stage: needs patch -> patch review
___
Python tracker
<http://bugs.python.org/issue14178>
___
___
New submission from Eli Bendersky :
Following issue #14178:
The ElementTree.ParseError is not documented and its behavior seems to differ
between the C and Python implementations. In particular, the C module doesn't
assign the 'code' attribute when raisi
Eli Bendersky added the comment:
WRT the ParseError problem, I've opened issue #14207 for it since the problems
are quite unrelated.
--
title: Failing tests for ElementTree -> _elementtree problem deleting slices
with steps != +1
__
Eli Bendersky added the comment:
> BTW, the issue 6488 is still opened. I did not check if there's something
> left to do before to close it.
The fundamental problem issue #6488 was opened for still exists - the docs use
the term "path" without defining it. Thi
Eli Bendersky added the comment:
Thanks, Florian - I will review the patch. At first sight it looks much better
than what exists.
--
___
Python tracker
<http://bugs.python.org/issue14
Eli Bendersky added the comment:
Éric,
I'm ok with replacing "lightweight" by "minimal", unless others have
objections. Regarding the specifics of the minidom-desc-2.diff patch:
"proficient with the DOM"
I'm not sure "the DOM" is sem
Changes by Eli Bendersky :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eli Bendersky added the comment:
Hi Phil,
Could you please post the problematic code snippet that runs with 3.2 but not
3.3?
Thanks in advance
--
___
Python tracker
<http://bugs.python.org/issue14
Eli Bendersky added the comment:
Note that this code works fine:
---
tree = ET.ElementTree()
stream = io.BytesIO()
stream.write(b'''
''')
stream.seek(0)
tree.par
Changes by Eli Bendersky :
--
assignee: -> eli.bendersky
keywords: +3.2regression
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/i
Eli Bendersky added the comment:
Both the Python ET and _elementtree use expat, but reach its parsing function
in a different path when given a file-like object (StringIO, BytesIO).
Python ET reads the stream itself and passes the data to pyexpat's Parse
method, which uses PyArg_Parse
Eli Bendersky added the comment:
Issue #13358 may be related
--
nosy: +eli.bendersky
___
Python tracker
<http://bugs.python.org/issue14250>
___
___
Python-bug
Eli Bendersky added the comment:
Oh, sorry I meant http://bugs.python.org/issue13385
--
___
Python tracker
<http://bugs.python.org/issue14250>
___
___
Python-bug
Eli Bendersky added the comment:
Attaching a patch that fixes the problem and adds a test.
xmlparser_parse from _elementtree will now be able to handle Unicode, encoding
it to bytes with UTF-8, parallel to the way it's done in pyexpat.
I would appreciate a review for the
Eli Bendersky added the comment:
Stefan,
Thanks a lot for taking the time to review the patch. As you correctly say, the
current pathch's goal is just to align with existing behavior in the Python
implementation of ET.
I understand the problem you are describing, but at least it
Eli Bendersky added the comment:
I reviewed the patch in http://bugs.python.org/review/14202/show
--
___
Python tracker
<http://bugs.python.org/issue14
Eli Bendersky added the comment:
Looks good, pending fixing of Éric's comments. Florian, could you do that? We
can then proceed to commit (to 3.3) and consider backports.
--
stage: needs patch -> patch review
___
Python tracke
Changes by Eli Bendersky :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Eli Bendersky :
--
assignee: -> eli.bendersky
versions: -Python 3.2
___
Python tracker
<http://bugs.python.org/issue14065>
___
___
Python-bugs-lis
Eli Bendersky added the comment:
Martin, why do you think it's important for Element to support this? After all,
this is XML, not an arbitrary tree. As such, the children of Element can only
be other elements, and attribute values should be strings. Anything else will
result in errors
Changes by Eli Bendersky :
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
401 - 500 of 1229 matches
Mail list logo