classification
Title: How to add end_lineno in pyclbr?
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, cheryl.sabella, gvanrossum, kebab-mai-haddi
Priority: normal Keywords:

Created on 2021-01-13 07:18 by kebab-mai-haddi, last changed 2021-01-14 19:12 by BTaskaya. This issue is now closed.

Messages (3)
msg385002 - (view) Author: Aviral Srivastava (kebab-mai-haddi) Date: 2021-01-13 07:18
I created a PR a year ago, https://github.com/python/cpython/pull/16466/files, and now the source code is completely changed. How do I create another PR or if there is another way through which I can get an end line for each object (class and function) as stated here(https://stackoverflow.com/questions/58142456/how-to-get-the-scope-of-a-class-in-terms-of-starting-line-and-end-line-in-python).
msg385074 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-01-14 19:09
Hopefully Batuhan (who changed this code ~2 months ago) or Cheryl (who reviewed your previous patch) can help you. You can just close your existing PR and create a new one, still linking to your original issue 38307.
msg385075 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2021-01-14 19:12
It is actually much easier now, considering that we are operating on the AST instead of the token stream. You probably only have to add a new field to Function/Class classes for end_lineno and access .end_lineno attribute here just like how we do for .lineno 
https://github.com/python/cpython/blob/971235827754eee6c0d9f7d39b52fecdfd4cb7b4/Lib/pyclbr.py#L212-L214
History
Date User Action Args
2021-01-14 19:12:27BTaskayasetmessages: + msg385075
2021-01-14 19:09:29gvanrossumsetstatus: open -> closed

nosy: + gvanrossum, cheryl.sabella, BTaskaya
messages: + msg385074

resolution: duplicate
stage: resolved
2021-01-13 07:18:44kebab-mai-haddicreate