classification
Title: pdb.do_args: display keyword-only and positional only arguments
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: blueyed, miss-islington, pablogsal, remi.lapeyre
Priority: normal Keywords: patch

Created on 2019-05-19 22:55 by blueyed, last changed 2019-05-24 20:44 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13452 merged remi.lapeyre, 2019-05-20 21:32
PR 13453 merged miss-islington, 2019-05-20 22:18
PR 13459 merged remi.lapeyre, 2019-05-21 10:32
Messages (9)
msg342878 - (view) Author: daniel hahler (blueyed) * Date: 2019-05-19 22:55
With a program like the following, `args` will not display the keyword-only argument:

```
def f1(arg=None, *, kwonly=None):
    __import__('pdb').set_trace()


f1()
```

```
(Pdb) args
arg = 'arg'
kw = 'kw'
```

Related code:
https://github.com/python/cpython/blob/5c08ce9bf712acbb3f05a3a57baf51fcb534cdf0/Lib/pdb.py#L1129-L1144
msg342958 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-20 22:08
Notice that pdb also does not handle correctly PEP570:

def f1(x,/,arg=None, *, kwonly=None):
    breakpoint()

f1(3)
-> breakpoint()
(Pdb) args
x = 3
msg342959 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-20 22:17
New changeset bf457c7d8224179a023957876e757f2a7ffc3d9d by Pablo Galindo (Rémi Lapeyre) in branch 'master':
bpo-36969: Make PDB args command display keyword only arguments (GH-13452)
https://github.com/python/cpython/commit/bf457c7d8224179a023957876e757f2a7ffc3d9d
msg342960 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-20 22:20
Rémi, could you do a PR addressing co_posonlyargcount?
msg342961 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-05-20 22:21
> Rémi, could you do a PR addressing co_posonlyargcount?
Of course, should I open a new PR or post a patch to be added to a current PR?
msg342963 - (view) Author: miss-islington (miss-islington) Date: 2019-05-20 22:34
New changeset 50b3f205d82d88eec69f18a0ad4bb2440ba73501 by Miss Islington (bot) in branch '3.7':
bpo-36969: Make PDB args command display keyword only arguments (GH-13452)
https://github.com/python/cpython/commit/50b3f205d82d88eec69f18a0ad4bb2440ba73501
msg342990 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-21 09:15
> Of course, should I open a new PR or post a patch to be added to a current PR?

Make another PR against master.
msg343425 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-24 20:44
New changeset 458560347f5c28e162bb288adfa0cfe5aad79557 by Pablo Galindo (Rémi Lapeyre) in branch 'master':
bpo-36969: Make PDB args command display positional only arguments (GH-13459)
https://github.com/python/cpython/commit/458560347f5c28e162bb288adfa0cfe5aad79557
msg343426 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-05-24 20:44
Thanks Rémi for the PRs! :)
History
Date User Action Args
2019-05-24 20:44:57pablogsalsetstatus: open -> closed
resolution: fixed
messages: + msg343426

stage: patch review -> resolved
2019-05-24 20:44:34pablogsalsetmessages: + msg343425
2019-05-21 10:32:30remi.lapeyresettitle: pdb: do_args: display/handle keyword-only arguments -> pdb.do_args: display keyword-only and positional only arguments
2019-05-21 10:32:05remi.lapeyresetpull_requests: + pull_request13369
2019-05-21 09:15:37pablogsalsetmessages: + msg342990
2019-05-20 22:34:26miss-islingtonsetnosy: + miss-islington
messages: + msg342963
2019-05-20 22:21:20remi.lapeyresetnosy: + remi.lapeyre
messages: + msg342961
2019-05-20 22:20:11pablogsalsetmessages: + msg342960
2019-05-20 22:18:02miss-islingtonsetpull_requests: + pull_request13362
2019-05-20 22:17:33pablogsalsetmessages: + msg342959
2019-05-20 22:08:42pablogsalsetnosy: + pablogsal
messages: + msg342958
2019-05-20 21:32:36remi.lapeyresetkeywords: + patch
stage: patch review
pull_requests: + pull_request13361
2019-05-19 22:55:08blueyedcreate