New submission from julien tayon <jul...@tayon.net>: well, you want to use python3 -mcProfile -othis.prof 'oneliner in python to test something'
And weirdly enough this normally expected behaviour does not work. It's because last argument is expected to be the path of the script name to profile. But, it can be fixed easily with no downside Since it is an expected behaviour and is minimal changing anything in documentation or news seems to superfluous An exemple of « this is a standard de fait » is the fact that the awesome module of vstinner timeit does this already. https://github.com/python/cpython/pull/30859 ---------- components: Library (Lib) messages: 411517 nosy: jul2, vstinner priority: normal pull_requests: 29042 severity: normal status: open title: enabling cProfile to profile code given as an argument "à la" timeit type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46507> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com