[issue44405] add program passed as string to dis module.

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Neither of tokenize, ast or symtable modules support passing the source string as argument. If add this feature in the dis module, we will need to add it in all other modules with similar CLI. I do not think it is practical. You always can pass the source

[issue44405] add program passed as string to dis module.

2021-07-23 Thread Nick Coghlan
Nick Coghlan added the comment: I suspect the only reason the dis CLI isn't documented is because it's been around for so long (22 years!) that nobody previously noticed it was missing: https://github.com/python/cpython/commit/1fdae12c93246fcf4abbf882ba08df789070dfcc Folks then either

[issue44405] add program passed as string to dis module.

2021-06-17 Thread Emmanuel Arias
Change by Emmanuel Arias : -- nosy: +eamanu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44405] add program passed as string to dis module.

2021-06-13 Thread Arjun
Change by Arjun : -- pull_requests: +25302 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26714 ___ Python tracker ___

[issue44405] add program passed as string to dis module.

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I often use the command-line interface of dis, ast, and sometimes tokenize modules. They are mature enough and not only for self-testing. If they are not documented, we need to document them. Since they read from stdin by default (no need to specify

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: > If _test were considered obsolete, it could be removed. removing _test: https://github.com/CCLDArjun/cpython/commit/8b3b8ccef0ef693f8f4105fd1eb56e9386675301 does not break dis tests. -- ___ Python tracker

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: > If _test were considered obsolete, it could be removed. Yup, originally it was added 2 decades ago (in 2000) originally as a test: 1fdae12c932 -- ___ Python tracker

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
Arjun added the comment: Huh, that's actually weird that the "exisisting command line interface" (quotes because it was added as a test) isn't official. I've found it to be convinient as a newcomer to the cpython codebase. > What is unusual, I think, for a CLI test function is that it

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: What is unusual, I think, for a CLI test function is that it requires a passed in argument. As a sanity-check test, 'python -m dis' could (should) disassemble itself. Perhaps there once were some true tests that were moved to unittests. (I started IDLE

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I checked https://docs.python.org/3/library/dis.html and there is no mention of dis having a command-line interface. This suggests that _test is likely present only for testing the module, not for using it. This was common a couple of decades ago before

[issue44405] add program passed as string to dis module.

2021-06-12 Thread Arjun
New submission from Arjun : python dis module should have a program passed in as string. Currently, you can do this: $ echo "x = 6" | python -m dis /dev/stdin 1 0 LOAD_CONST 0 (6) 2 STORE_NAME 0 (x) 4 LOAD_CONST