Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a6968edc
Kaydet (Commit)
a6968edc
authored
Eki 09, 2011
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge whatsnew fixes with 3.2.
üst
5b194cc8
4e158286
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
2.7.rst
Doc/whatsnew/2.7.rst
+10
-7
No files found.
Doc/whatsnew/2.7.rst
Dosyayı görüntüle @
a6968edc
...
@@ -1952,7 +1952,7 @@ The version of the ElementTree library included with Python was updated to
...
@@ -1952,7 +1952,7 @@ The version of the ElementTree library included with Python was updated to
version 1.3. Some of the new features are:
version 1.3. Some of the new features are:
* The various parsing functions now take a *parser* keyword argument
* The various parsing functions now take a *parser* keyword argument
giving an :class:`XMLParser` instance that will
giving an :class:`
~xml.etree.ElementTree.
XMLParser` instance that will
be used. This makes it possible to override the file's internal encoding::
be used. This makes it possible to override the file's internal encoding::
p = ET.XMLParser(encoding='utf-8')
p = ET.XMLParser(encoding='utf-8')
...
@@ -1964,8 +1964,8 @@ version 1.3. Some of the new features are:
...
@@ -1964,8 +1964,8 @@ version 1.3. Some of the new features are:
* ElementTree's code for converting trees to a string has been
* ElementTree's code for converting trees to a string has been
significantly reworked, making it roughly twice as fast in many
significantly reworked, making it roughly twice as fast in many
cases. The :
class:`ElementTree` :meth:`write` and :class:`Element
`
cases. The :
meth:`ElementTree.write() <xml.etree.ElementTree.ElementTree.write>
`
:meth:`
write` methods now have a *method* parameter that can be
and :meth:`Element.
write` methods now have a *method* parameter that can be
"xml" (the default), "html", or "text". HTML mode will output empty
"xml" (the default), "html", or "text". HTML mode will output empty
elements as ``<empty></empty>`` instead of ``<empty/>``, and text
elements as ``<empty></empty>`` instead of ``<empty/>``, and text
mode will skip over elements and only output the text chunks. If
mode will skip over elements and only output the text chunks. If
...
@@ -1978,11 +1978,12 @@ version 1.3. Some of the new features are:
...
@@ -1978,11 +1978,12 @@ version 1.3. Some of the new features are:
declarations are now output on the root element, not scattered throughout
declarations are now output on the root element, not scattered throughout
the resulting XML. You can set the default namespace for a tree
the resulting XML. You can set the default namespace for a tree
by setting the :attr:`default_namespace` attribute and can
by setting the :attr:`default_namespace` attribute and can
register new prefixes with :meth:`register_namespace`. In XML mode,
register new prefixes with :meth:`
~xml.etree.ElementTree.
register_namespace`. In XML mode,
you can use the true/false *xml_declaration* parameter to suppress the
you can use the true/false *xml_declaration* parameter to suppress the
XML declaration.
XML declaration.
* New :class:`Element` method: :meth:`extend` appends the items from a
* New :class:`~xml.etree.ElementTree.Element` method:
:meth:`~xml.etree.ElementTree.Element.extend` appends the items from a
sequence to the element's children. Elements themselves behave like
sequence to the element's children. Elements themselves behave like
sequences, so it's easy to move children from one element to
sequences, so it's easy to move children from one element to
another::
another::
...
@@ -1998,13 +1999,15 @@ version 1.3. Some of the new features are:
...
@@ -1998,13 +1999,15 @@ version 1.3. Some of the new features are:
# Outputs <root><item>1</item>...</root>
# Outputs <root><item>1</item>...</root>
print ET.tostring(new)
print ET.tostring(new)
* New :class:`Element` method: :meth:`iter` yields the children of the
* New :class:`Element` method:
:meth:`~xml.etree.ElementTree.Element.iter` yields the children of the
element as a generator. It's also possible to write ``for child in
element as a generator. It's also possible to write ``for child in
elem:`` to loop over an element's children. The existing method
elem:`` to loop over an element's children. The existing method
:meth:`getiterator` is now deprecated, as is :meth:`getchildren`
:meth:`getiterator` is now deprecated, as is :meth:`getchildren`
which constructs and returns a list of children.
which constructs and returns a list of children.
* New :class:`Element` method: :meth:`itertext` yields all chunks of
* New :class:`Element` method:
:meth:`~xml.etree.ElementTree.Element.itertext` yields all chunks of
text that are descendants of the element. For example::
text that are descendants of the element. For example::
t = ET.XML("""<list>
t = ET.XML("""<list>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment