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
db9b65d9
Kaydet (Commit)
db9b65d9
authored
Ara 13, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22823: Use set literals in lib2to3.
üst
bd62f0a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
fixer_util.py
Lib/lib2to3/fixer_util.py
+4
-4
fix_dict.py
Lib/lib2to3/fixes/fix_dict.py
+1
-1
patcomp.py
Lib/lib2to3/patcomp.py
+1
-1
refactor.py
Lib/lib2to3/refactor.py
+2
-2
No files found.
Lib/lib2to3/fixer_util.py
Dosyayı görüntüle @
db9b65d9
...
...
@@ -187,8 +187,8 @@ def parenthesize(node):
return
Node
(
syms
.
atom
,
[
LParen
(),
node
,
RParen
()])
consuming_calls
=
set
([
"sorted"
,
"list"
,
"set"
,
"any"
,
"all"
,
"tuple"
,
"sum"
,
"min"
,
"max"
,
"enumerate"
])
consuming_calls
=
{
"sorted"
,
"list"
,
"set"
,
"any"
,
"all"
,
"tuple"
,
"sum"
,
"min"
,
"max"
,
"enumerate"
}
def
attr_chain
(
obj
,
attr
):
"""Follow an attribute chain.
...
...
@@ -359,7 +359,7 @@ def touch_import(package, name, node):
root
.
insert_child
(
insert_pos
,
Node
(
syms
.
simple_stmt
,
children
))
_def_syms
=
set
([
syms
.
classdef
,
syms
.
funcdef
])
_def_syms
=
{
syms
.
classdef
,
syms
.
funcdef
}
def
find_binding
(
name
,
node
,
package
=
None
):
""" Returns the node which binds variable name, otherwise None.
If optional argument package is supplied, only imports will
...
...
@@ -402,7 +402,7 @@ def find_binding(name, node, package=None):
return
ret
return
None
_block_syms
=
set
([
syms
.
funcdef
,
syms
.
classdef
,
syms
.
trailer
])
_block_syms
=
{
syms
.
funcdef
,
syms
.
classdef
,
syms
.
trailer
}
def
_find
(
name
,
node
):
nodes
=
[
node
]
while
nodes
:
...
...
Lib/lib2to3/fixes/fix_dict.py
Dosyayı görüntüle @
db9b65d9
...
...
@@ -36,7 +36,7 @@ from ..fixer_util import Name, Call, LParen, RParen, ArgList, Dot
from
..
import
fixer_util
iter_exempt
=
fixer_util
.
consuming_calls
|
set
([
"iter"
])
iter_exempt
=
fixer_util
.
consuming_calls
|
{
"iter"
}
class
FixDict
(
fixer_base
.
BaseFix
):
...
...
Lib/lib2to3/patcomp.py
Dosyayı görüntüle @
db9b65d9
...
...
@@ -32,7 +32,7 @@ class PatternSyntaxError(Exception):
def
tokenize_wrapper
(
input
):
"""Tokenizes a string suppressing significant whitespace."""
skip
=
set
((
token
.
NEWLINE
,
token
.
INDENT
,
token
.
DEDENT
))
skip
=
{
token
.
NEWLINE
,
token
.
INDENT
,
token
.
DEDENT
}
tokens
=
tokenize
.
generate_tokens
(
io
.
StringIO
(
input
)
.
readline
)
for
quintuple
in
tokens
:
type
,
value
,
start
,
end
,
line_text
=
quintuple
...
...
Lib/lib2to3/refactor.py
Dosyayı görüntüle @
db9b65d9
...
...
@@ -57,7 +57,7 @@ def _get_head_types(pat):
# Always return leafs
if
pat
.
type
is
None
:
raise
_EveryNode
return
set
([
pat
.
type
])
return
{
pat
.
type
}
if
isinstance
(
pat
,
pytree
.
NegatedPattern
):
if
pat
.
content
:
...
...
@@ -133,7 +133,7 @@ def _detect_future_features(source):
def
advance
():
tok
=
next
(
gen
)
return
tok
[
0
],
tok
[
1
]
ignore
=
frozenset
(
(
token
.
NEWLINE
,
tokenize
.
NL
,
token
.
COMMENT
)
)
ignore
=
frozenset
(
{
token
.
NEWLINE
,
tokenize
.
NL
,
token
.
COMMENT
}
)
features
=
set
()
try
:
while
True
:
...
...
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