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
13b56efa
Kaydet (Commit)
13b56efa
authored
Eyl 10, 2016
tarafından
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove fix_callable, callable() was readded long ago in 3.x.
üst
88c00132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
37 deletions
+0
-37
fix_callable.py
Lib/lib2to3/fixes/fix_callable.py
+0
-37
No files found.
Lib/lib2to3/fixes/fix_callable.py
deleted
100644 → 0
Dosyayı görüntüle @
88c00132
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from
lib2to3
import
fixer_base
from
lib2to3.fixer_util
import
Call
,
Name
,
String
,
Attr
,
touch_import
class
FixCallable
(
fixer_base
.
BaseFix
):
BM_compatible
=
True
order
=
"pre"
# Ignore callable(*args) or use of keywords.
# Either could be a hint that the builtin callable() is not being used.
PATTERN
=
"""
power< 'callable'
trailer< lpar='('
( not(arglist | argument<any '=' any>) func=any
| func=arglist<(not argument<any '=' any>) any ','> )
rpar=')' >
after=any*
>
"""
def
transform
(
self
,
node
,
results
):
func
=
results
[
'func'
]
touch_import
(
None
,
u'collections'
,
node
=
node
)
args
=
[
func
.
clone
(),
String
(
u', '
)]
args
.
extend
(
Attr
(
Name
(
u'collections'
),
Name
(
u'Callable'
)))
return
Call
(
Name
(
u'isinstance'
),
args
,
prefix
=
node
.
prefix
)
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