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
8cf4b51f
Kaydet (Commit)
8cf4b51f
authored
Mar 05, 2012
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xml.dom.minidom: add more __slots__ to limit resource usage.
üst
6c75301e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
__init__.py
Lib/xml/dom/__init__.py
+1
-0
minidom.py
Lib/xml/dom/minidom.py
+7
-6
No files found.
Lib/xml/dom/__init__.py
Dosyayı görüntüle @
8cf4b51f
...
@@ -17,6 +17,7 @@ pulldom -- DOM builder supporting on-demand tree-building for selected
...
@@ -17,6 +17,7 @@ pulldom -- DOM builder supporting on-demand tree-building for selected
class
Node
:
class
Node
:
"""Class giving the NodeType constants."""
"""Class giving the NodeType constants."""
__slots__
=
()
# DOM implementations may use this as a base class for their own
# DOM implementations may use this as a base class for their own
# Node implementations. If they don't, the constants defined here
# Node implementations. If they don't, the constants defined here
...
...
Lib/xml/dom/minidom.py
Dosyayı görüntüle @
8cf4b51f
...
@@ -62,10 +62,7 @@ class Node(xml.dom.Node):
...
@@ -62,10 +62,7 @@ class Node(xml.dom.Node):
return
writer
.
stream
.
getvalue
()
return
writer
.
stream
.
getvalue
()
def
hasChildNodes
(
self
):
def
hasChildNodes
(
self
):
if
self
.
childNodes
:
return
bool
(
self
.
childNodes
)
return
True
else
:
return
False
def
_get_childNodes
(
self
):
def
_get_childNodes
(
self
):
return
self
.
childNodes
return
self
.
childNodes
...
@@ -930,6 +927,7 @@ class Childless:
...
@@ -930,6 +927,7 @@ class Childless:
"""Mixin that makes childless-ness easy to implement and avoids
"""Mixin that makes childless-ness easy to implement and avoids
the complexity of the Node methods that deal with children.
the complexity of the Node methods that deal with children.
"""
"""
__slots__
=
()
attributes
=
None
attributes
=
None
childNodes
=
EmptyNodeList
()
childNodes
=
EmptyNodeList
()
...
@@ -1067,6 +1065,8 @@ defproperty(CharacterData, "length", doc="Length of the string data.")
...
@@ -1067,6 +1065,8 @@ defproperty(CharacterData, "length", doc="Length of the string data.")
class
Text
(
CharacterData
):
class
Text
(
CharacterData
):
__slots__
=
()
nodeType
=
Node
.
TEXT_NODE
nodeType
=
Node
.
TEXT_NODE
nodeName
=
"#text"
nodeName
=
"#text"
attributes
=
None
attributes
=
None
...
@@ -1188,6 +1188,8 @@ class Comment(CharacterData):
...
@@ -1188,6 +1188,8 @@ class Comment(CharacterData):
class
CDATASection
(
Text
):
class
CDATASection
(
Text
):
__slots__
=
()
nodeType
=
Node
.
CDATA_SECTION_NODE
nodeType
=
Node
.
CDATA_SECTION_NODE
nodeName
=
"#cdata-section"
nodeName
=
"#cdata-section"
...
@@ -1266,8 +1268,7 @@ defproperty(ReadOnlySequentialNamedNodeMap, "length",
...
@@ -1266,8 +1268,7 @@ defproperty(ReadOnlySequentialNamedNodeMap, "length",
class
Identified
:
class
Identified
:
"""Mix-in class that supports the publicId and systemId attributes."""
"""Mix-in class that supports the publicId and systemId attributes."""
# XXX this does not work, this is an old-style class
__slots__
=
'publicId'
,
'systemId'
# __slots__ = 'publicId', 'systemId'
def
_identified_mixin_init
(
self
,
publicId
,
systemId
):
def
_identified_mixin_init
(
self
,
publicId
,
systemId
):
self
.
publicId
=
publicId
self
.
publicId
=
publicId
...
...
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