PyAsm

Roger Binns rogerb at rogerbinns.com
Thu Mar 10 17:58:09 CET 2005


"Stefan Behnel" <stefan.behnel-n05pAM at web.de> wrote in message news:d0pjsb$ghr$1 at lnx107.hrz.tu-darmstadt.de...
> Meaning: Put the assembler into the doc-string of a function.

That has several issues.  One is that you can't do string operations with
it.  Say you wanted some %d, %s etc in the string.  If you use a documentation
generator (eg epydoc) then the code becomes the API documentation for the
function.  Finally it bloats binary distributions.  For example BitPim
is 7-10MB binary distribution, full compressed with all doc strings
removed.  Including doc strings adds another 3MB to the compressed binary
size!

Instead I would suggest looking at the compile/eval/exec builtins in Python
for inspiration.  You can give a string to compile and it gives you something
you can execute later in varying contexts.

Roger 





More information about the Python-list mailing list