New submission from Gold Games <noureddine.ha...@usmba.ac.ma>:

inspect.getsource ignore comments at the end of the function:

for example this function:

def matmul_single(A, x, out):
  from numpy import matmul
  out[:] = matmul(A, x)
  # Some comment here...

using the inspect library:
>>> inspect.getsource(matmul_single)                                            
>>>                                                                             
>>>              
>>> "def omp_matmul_single(A, x, out):\n  from numpy import matmul\n out[:] = 
>>> matmul(A, x)\n"

the result does not contain the comments at the end of the function.

----------
components: Library (Lib)
messages: 379289
nosy: noureddine.hamid
priority: normal
severity: normal
status: open
title: Inspect library ignore comments at the end of a function 
(inspect.getsource)
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to