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
e037665f
Kaydet (Commit)
e037665f
authored
May 10, 2002
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use isinstance() in preference to comparison of type by is.
üst
fad2f593
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
StringIO.py
Lib/StringIO.py
+2
-2
No files found.
Lib/StringIO.py
Dosyayı görüntüle @
e037665f
...
@@ -39,7 +39,7 @@ __all__ = ["StringIO"]
...
@@ -39,7 +39,7 @@ __all__ = ["StringIO"]
class
StringIO
:
class
StringIO
:
def
__init__
(
self
,
buf
=
''
):
def
__init__
(
self
,
buf
=
''
):
# Force self.buf to be a string or unicode
# Force self.buf to be a string or unicode
if
type
(
buf
)
is
not
types
.
UnicodeType
:
if
not
isinstance
(
buf
,
types
.
UnicodeType
)
:
buf
=
str
(
buf
)
buf
=
str
(
buf
)
self
.
buf
=
buf
self
.
buf
=
buf
self
.
len
=
len
(
buf
)
self
.
len
=
len
(
buf
)
...
@@ -138,7 +138,7 @@ class StringIO:
...
@@ -138,7 +138,7 @@ class StringIO:
raise
ValueError
,
"I/O operation on closed file"
raise
ValueError
,
"I/O operation on closed file"
if
not
s
:
return
if
not
s
:
return
# Force s to be a string or unicode
# Force s to be a string or unicode
if
type
(
s
)
is
not
types
.
UnicodeType
:
if
not
isinstance
(
s
,
types
.
UnicodeType
)
:
s
=
str
(
s
)
s
=
str
(
s
)
if
self
.
pos
>
self
.
len
:
if
self
.
pos
>
self
.
len
:
self
.
buflist
.
append
(
'
\0
'
*
(
self
.
pos
-
self
.
len
))
self
.
buflist
.
append
(
'
\0
'
*
(
self
.
pos
-
self
.
len
))
...
...
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