Terry J. Reedy <tjre...@udel.edu> added the comment:

The doc begins
"30.12. dis — Disassembler for Python bytecode
The dis module supports the analysis of Python bytecode by disassembling it. 
Since there is no Python assembler, this module defines the Python assembly 
language. The Python bytecode which this module takes as an input is defined in 
the file Include/opcode.h and used by the compiler and the interpreter."

This goes back to when python.exe (CPython) was the only implementation. 
"Python bytecode" is no longer appropriate. It should be changed to CPython 
bytecode. My suggestion for a possible update:

30.12. dis — Disassembler for CPython bytecode
CPython currently compiles Python source code to a custom bytecode that is 
defined by the CPytyon source file Include/opcode.h and explained below. While 
such implementation details are subject to change in any CPython x.y version, 
the dis module supports the analysis of current bytecode by disassembling it to 
a format similar to assembly language."

Calling it an actual assembly language, as the current doc does, implies to me 
that there is/should be an assembler (which Guido has said there should not be).

"30.12.1. Python Bytecode Instructions
The Python compiler ..."

Python -> CPython

In the glossary:
"bytecode 
Python source code is compiled into bytecode, the internal representation of a 
Python program in the interpret"
=> something like
"bytecode
CPython currently compiles Python source code to an internal bytecode 
representation that it uses to execute the program. Some other implementations 
do something similar."

These suggestions touch on the larger issue of differentiating and 
disentangling language doc from CPython implementation doc. I support this even 
though I have never used any of the other implementations.

----------
nosy: +tjreedy

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

Reply via email to