mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-42116: Fix inspect.getsource handling of trailing comments (GH-23630)
This commit is contained in:
parent
066394018a
commit
6e1eec71f5
4 changed files with 49 additions and 4 deletions
|
@ -91,3 +91,25 @@ class Callable:
|
|||
|
||||
custom_method = Callable().as_method_of(42)
|
||||
del Callable
|
||||
|
||||
# line 95
|
||||
class WhichComments:
|
||||
# line 97
|
||||
# before f
|
||||
def f(self):
|
||||
# line 100
|
||||
# start f
|
||||
return 1
|
||||
# line 103
|
||||
# end f
|
||||
# line 105
|
||||
# after f
|
||||
|
||||
# before asyncf - line 108
|
||||
async def asyncf(self):
|
||||
# start asyncf
|
||||
return 2
|
||||
# end asyncf
|
||||
# after asyncf - line 113
|
||||
# end of WhichComments - line 114
|
||||
# after WhichComments - line 115
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue