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
45856034
Kaydet (Commit)
45856034
authored
May 24, 2019
tarafından
Rémi Lapeyre
Kaydeden (comit)
Pablo Galindo
May 24, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36969: Make PDB args command display positional only arguments (GH-13459)
üst
deffee57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
pdb.py
Lib/pdb.py
+1
-1
test_pdb.py
Lib/test/test_pdb.py
+28
-5
2019-05-21-12-31-21.bpo-36969.u7cxu7.rst
...S.d/next/Library/2019-05-21-12-31-21.bpo-36969.u7cxu7.rst
+2
-0
No files found.
Lib/pdb.py
Dosyayı görüntüle @
45856034
...
@@ -1132,7 +1132,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -1132,7 +1132,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
"""
"""
co
=
self
.
curframe
.
f_code
co
=
self
.
curframe
.
f_code
dict
=
self
.
curframe_locals
dict
=
self
.
curframe_locals
n
=
co
.
co_argcount
+
co
.
co_kwonlyargcount
n
=
co
.
co_argcount
+
co
.
co_
posonlyargcount
+
co
.
co_
kwonlyargcount
if
co
.
co_flags
&
inspect
.
CO_VARARGS
:
n
=
n
+
1
if
co
.
co_flags
&
inspect
.
CO_VARARGS
:
n
=
n
+
1
if
co
.
co_flags
&
inspect
.
CO_VARKEYWORDS
:
n
=
n
+
1
if
co
.
co_flags
&
inspect
.
CO_VARKEYWORDS
:
n
=
n
+
1
for
i
in
range
(
n
):
for
i
in
range
(
n
):
...
...
Lib/test/test_pdb.py
Dosyayı görüntüle @
45856034
...
@@ -80,10 +80,14 @@ def test_pdb_basic_commands():
...
@@ -80,10 +80,14 @@ def test_pdb_basic_commands():
>>> def test_function3(arg=None, *, kwonly=None):
>>> def test_function3(arg=None, *, kwonly=None):
... pass
... pass
>>> def test_function4(a, b, c, /):
... pass
>>> def test_function():
>>> def test_function():
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... ret = test_function_2('baz')
... ret = test_function_2('baz')
... test_function3(kwonly=True)
... test_function3(kwonly=True)
... test_function4(1, 2, 3)
... print(ret)
... print(ret)
>>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
>>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
...
@@ -104,10 +108,14 @@ def test_pdb_basic_commands():
...
@@ -104,10 +108,14 @@ def test_pdb_basic_commands():
... 'next', # step to test_function3()
... 'next', # step to test_function3()
... 'step', # stepping into test_function3()
... 'step', # stepping into test_function3()
... 'args', # display function args
... 'args', # display function args
... 'return', # return out of function
... 'next', # step to test_function4()
... 'step', # stepping to test_function4()
... 'args', # display function args
... 'continue',
... 'continue',
... ]):
... ]):
... test_function()
... test_function()
> <doctest test.test_pdb.test_pdb_basic_commands[
2
]>(3)test_function()
> <doctest test.test_pdb.test_pdb_basic_commands[
3
]>(3)test_function()
-> ret = test_function_2('baz')
-> ret = test_function_2('baz')
(Pdb) step
(Pdb) step
--Call--
--Call--
...
@@ -130,14 +138,14 @@ def test_pdb_basic_commands():
...
@@ -130,14 +138,14 @@ def test_pdb_basic_commands():
[EOF]
[EOF]
(Pdb) bt
(Pdb) bt
...
...
<doctest test.test_pdb.test_pdb_basic_commands[
3]>(21
)<module>()
<doctest test.test_pdb.test_pdb_basic_commands[
4]>(25
)<module>()
-> test_function()
-> test_function()
<doctest test.test_pdb.test_pdb_basic_commands[
2
]>(3)test_function()
<doctest test.test_pdb.test_pdb_basic_commands[
3
]>(3)test_function()
-> ret = test_function_2('baz')
-> ret = test_function_2('baz')
> <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
> <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
-> def test_function_2(foo, bar='default'):
-> def test_function_2(foo, bar='default'):
(Pdb) up
(Pdb) up
> <doctest test.test_pdb.test_pdb_basic_commands[
2
]>(3)test_function()
> <doctest test.test_pdb.test_pdb_basic_commands[
3
]>(3)test_function()
-> ret = test_function_2('baz')
-> ret = test_function_2('baz')
(Pdb) down
(Pdb) down
> <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
> <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
...
@@ -176,7 +184,7 @@ def test_pdb_basic_commands():
...
@@ -176,7 +184,7 @@ def test_pdb_basic_commands():
(Pdb) retval
(Pdb) retval
'BAZ'
'BAZ'
(Pdb) next
(Pdb) next
> <doctest test.test_pdb.test_pdb_basic_commands[
2
]>(4)test_function()
> <doctest test.test_pdb.test_pdb_basic_commands[
3
]>(4)test_function()
-> test_function3(kwonly=True)
-> test_function3(kwonly=True)
(Pdb) step
(Pdb) step
--Call--
--Call--
...
@@ -185,6 +193,21 @@ def test_pdb_basic_commands():
...
@@ -185,6 +193,21 @@ def test_pdb_basic_commands():
(Pdb) args
(Pdb) args
arg = None
arg = None
kwonly = True
kwonly = True
(Pdb) return
--Return--
> <doctest test.test_pdb.test_pdb_basic_commands[1]>(2)test_function3()->None
-> pass
(Pdb) next
> <doctest test.test_pdb.test_pdb_basic_commands[3]>(5)test_function()
-> test_function4(1, 2, 3)
(Pdb) step
--Call--
> <doctest test.test_pdb.test_pdb_basic_commands[2]>(1)test_function4()
-> def test_function4(a, b, c, /):
(Pdb) args
a = 1
b = 2
c = 3
(Pdb) continue
(Pdb) continue
BAZ
BAZ
"""
"""
...
...
Misc/NEWS.d/next/Library/2019-05-21-12-31-21.bpo-36969.u7cxu7.rst
0 → 100644
Dosyayı görüntüle @
45856034
PDB command `args` now display positional only arguments. Patch contributed
by Rémi Lapeyre.
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