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
cf7925df
Kaydet (Commit)
cf7925df
authored
May 09, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove unneeded uses of str()
üst
d481e3d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
fix_imports.py
Lib/lib2to3/fixes/fix_imports.py
+1
-1
fix_methodattrs.py
Lib/lib2to3/fixes/fix_methodattrs.py
+1
-1
fix_renames.py
Lib/lib2to3/fixes/fix_renames.py
+1
-1
fix_types.py
Lib/lib2to3/fixes/fix_types.py
+1
-1
No files found.
Lib/lib2to3/fixes/fix_imports.py
Dosyayı görüntüle @
cf7925df
...
@@ -123,7 +123,7 @@ class FixImports(fixer_base.BaseFix):
...
@@ -123,7 +123,7 @@ class FixImports(fixer_base.BaseFix):
import_mod
=
results
.
get
(
"module_name"
)
import_mod
=
results
.
get
(
"module_name"
)
if
import_mod
:
if
import_mod
:
mod_name
=
import_mod
.
value
mod_name
=
import_mod
.
value
new_name
=
s
tr
(
self
.
mapping
[
mod_name
])
new_name
=
s
elf
.
mapping
[
mod_name
]
import_mod
.
replace
(
Name
(
new_name
,
prefix
=
import_mod
.
get_prefix
()))
import_mod
.
replace
(
Name
(
new_name
,
prefix
=
import_mod
.
get_prefix
()))
if
"name_import"
in
results
:
if
"name_import"
in
results
:
# If it's not a "from x import x, y" or "import x as y" import,
# If it's not a "from x import x, y" or "import x as y" import,
...
...
Lib/lib2to3/fixes/fix_methodattrs.py
Dosyayı görüntüle @
cf7925df
...
@@ -19,5 +19,5 @@ class FixMethodattrs(fixer_base.BaseFix):
...
@@ -19,5 +19,5 @@ class FixMethodattrs(fixer_base.BaseFix):
def
transform
(
self
,
node
,
results
):
def
transform
(
self
,
node
,
results
):
attr
=
results
[
"attr"
][
0
]
attr
=
results
[
"attr"
][
0
]
new
=
str
(
MAP
[
attr
.
value
])
new
=
MAP
[
attr
.
value
]
attr
.
replace
(
Name
(
new
,
prefix
=
attr
.
get_prefix
()))
attr
.
replace
(
Name
(
new
,
prefix
=
attr
.
get_prefix
()))
Lib/lib2to3/fixes/fix_renames.py
Dosyayı görüntüle @
cf7925df
...
@@ -65,5 +65,5 @@ class FixRenames(fixer_base.BaseFix):
...
@@ -65,5 +65,5 @@ class FixRenames(fixer_base.BaseFix):
#import_mod = results.get("module")
#import_mod = results.get("module")
if
mod_name
and
attr_name
:
if
mod_name
and
attr_name
:
new_attr
=
str
(
LOOKUP
[(
mod_name
.
value
,
attr_name
.
value
)])
new_attr
=
LOOKUP
[(
mod_name
.
value
,
attr_name
.
value
)]
attr_name
.
replace
(
Name
(
new_attr
,
prefix
=
attr_name
.
get_prefix
()))
attr_name
.
replace
(
Name
(
new_attr
,
prefix
=
attr_name
.
get_prefix
()))
Lib/lib2to3/fixes/fix_types.py
Dosyayı görüntüle @
cf7925df
...
@@ -56,7 +56,7 @@ class FixTypes(fixer_base.BaseFix):
...
@@ -56,7 +56,7 @@ class FixTypes(fixer_base.BaseFix):
PATTERN
=
'|'
.
join
(
_pats
)
PATTERN
=
'|'
.
join
(
_pats
)
def
transform
(
self
,
node
,
results
):
def
transform
(
self
,
node
,
results
):
new_value
=
str
(
_TYPE_MAPPING
.
get
(
results
[
"name"
]
.
value
)
)
new_value
=
_TYPE_MAPPING
.
get
(
results
[
"name"
]
.
value
)
if
new_value
:
if
new_value
:
return
Name
(
new_value
,
prefix
=
node
.
get_prefix
())
return
Name
(
new_value
,
prefix
=
node
.
get_prefix
())
return
None
return
None
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