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
0714b8b6
Kaydet (Commit)
0714b8b6
authored
Şub 14, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
set line and column numbers for keyword-only arg nodes (closes #20619)
üst
15054c16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
test_ast.py
Lib/test/test_ast.py
+2
-2
NEWS
Misc/NEWS
+3
-0
ast.c
Python/ast.c
+2
-0
No files found.
Lib/test/test_ast.py
Dosyayı görüntüle @
0714b8b6
...
...
@@ -37,7 +37,7 @@ exec_tests = [
# FunctionDef with kwargs
"def f(**kwargs): pass"
,
# FunctionDef with all kind of args
"def f(a, b=1, c=None, d=[], e={}, *args, **kwargs): pass"
,
"def f(a, b=1, c=None, d=[], e={}, *args,
f=42,
**kwargs): pass"
,
# ClassDef
"class C:pass"
,
# ClassDef, new style class
...
...
@@ -973,7 +973,7 @@ exec_results = [
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[(
'arg'
,
(
1
,
6
),
'a'
,
None
)],
None
,
[],
[],
None
,
[(
'Num'
,
(
1
,
8
),
0
)]),
[(
'Pass'
,
(
1
,
12
))],
[],
None
)]),
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[],
(
'arg'
,
(
1
,
7
),
'args'
,
None
),
[],
[],
None
,
[]),
[(
'Pass'
,
(
1
,
14
))],
[],
None
)]),
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[],
None
,
[],
[],
(
'arg'
,
(
1
,
8
),
'kwargs'
,
None
),
[]),
[(
'Pass'
,
(
1
,
17
))],
[],
None
)]),
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[(
'arg'
,
(
1
,
6
),
'a'
,
None
),
(
'arg'
,
(
1
,
9
),
'b'
,
None
),
(
'arg'
,
(
1
,
14
),
'c'
,
None
),
(
'arg'
,
(
1
,
22
),
'd'
,
None
),
(
'arg'
,
(
1
,
28
),
'e'
,
None
)],
(
'arg'
,
(
1
,
35
),
'args'
,
None
),
[],
[],
(
'arg'
,
(
1
,
43
),
'kwargs'
,
None
),
[(
'Num'
,
(
1
,
11
),
1
),
(
'NameConstant'
,
(
1
,
16
),
None
),
(
'List'
,
(
1
,
24
),
[],
(
'Load'
,)),
(
'Dict'
,
(
1
,
30
),
[],
[])]),
[(
'Pass'
,
(
1
,
52
))],
[],
None
)]),
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[(
'arg'
,
(
1
,
6
),
'a'
,
None
),
(
'arg'
,
(
1
,
9
),
'b'
,
None
),
(
'arg'
,
(
1
,
14
),
'c'
,
None
),
(
'arg'
,
(
1
,
22
),
'd'
,
None
),
(
'arg'
,
(
1
,
28
),
'e'
,
None
)],
(
'arg'
,
(
1
,
35
),
'args'
,
None
),
[(
'arg'
,
(
1
,
41
),
'f'
,
None
)],
[(
'Num'
,
(
1
,
43
),
42
)],
(
'arg'
,
(
1
,
49
),
'kwargs'
,
None
),
[(
'Num'
,
(
1
,
11
),
1
),
(
'NameConstant'
,
(
1
,
16
),
None
),
(
'List'
,
(
1
,
24
),
[],
(
'Load'
,)),
(
'Dict'
,
(
1
,
30
),
[],
[])]),
[(
'Pass'
,
(
1
,
58
))],
[],
None
)]),
(
'Module'
,
[(
'ClassDef'
,
(
1
,
0
),
'C'
,
[],
[],
None
,
None
,
[(
'Pass'
,
(
1
,
8
))],
[])]),
(
'Module'
,
[(
'ClassDef'
,
(
1
,
0
),
'C'
,
[(
'Name'
,
(
1
,
8
),
'object'
,
(
'Load'
,))],
[],
None
,
None
,
[(
'Pass'
,
(
1
,
17
))],
[])]),
(
'Module'
,
[(
'FunctionDef'
,
(
1
,
0
),
'f'
,
(
'arguments'
,
[],
None
,
[],
[],
None
,
[]),
[(
'Return'
,
(
1
,
8
),
(
'Num'
,
(
1
,
15
),
1
))],
[],
None
)]),
...
...
Misc/NEWS
Dosyayı görüntüle @
0714b8b6
...
...
@@ -10,6 +10,9 @@ Release date: 2014-02-23
Core and Builtins
-----------------
- Issue #20619: Give the AST nodes of keyword-only arguments a column and line
number.
- Issue #20526: Revert changes of issue #19466 which introduces a regression:
don'
t
clear
anymore
the
state
of
Python
threads
early
during
the
Python
shutdown
.
...
...
Python/ast.c
Dosyayı görüntüle @
0714b8b6
...
...
@@ -1203,6 +1203,8 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
arg
=
arg
(
argname
,
annotation
,
c
->
c_arena
);
if
(
!
arg
)
goto
error
;
arg
->
lineno
=
LINENO
(
ch
);
arg
->
col_offset
=
ch
->
n_col_offset
;
asdl_seq_SET
(
kwonlyargs
,
j
++
,
arg
);
i
+=
2
;
/* the name and the comma */
break
;
...
...
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