python: docs for python-error

db4
Björn Lindqvist 2014-10-02 17:19:05 +02:00 committed by John Benediktsson
parent a530a10187
commit 43dc1ba259
3 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,5 @@
IN: python
USING: python help.markup help.syntax ;
USING: python python.throwing help.markup help.syntax ;
HELP: py-initialize
{ $description "Initializes the python binding. This word must be called before any other words in the api can be used" } ;
@ -19,9 +19,16 @@ HELP: >py
}
{ $see-also py> } ;
HELP: python-error
{ $error-description "When Python throws an exception, it is translated to this Factor error. " { $slot "type" } " is the class name of the python exception object, " { $slot "message" } " its string and " { $slot "traceback" } " a sequence of traceback lines, if the error has one, or " { $link f } " otherwise." } ;
ARTICLE: "python" "Python binding"
"The " { $vocab-link "python" } " vocab and its subvocabs implements a simple binding for libpython, allowing factor code to call native python."
$nl
"Converting to and from Python:"
{ $subsections >py py> }
"Error handling:"
{ $subsections python-error }
"Initialization and finalization:"
{ $subsections py-initialize py-finalize }
"Module management:"

View File

@ -5,6 +5,8 @@ specialized-arrays strings vectors ;
IN: python
QUALIFIED: math
ERROR: python-error type message traceback ;
SPECIALIZED-ARRAY: void*
! Borrowed from unix.utilities

View File

@ -1,8 +1,6 @@
USING: arrays kernel python python.ffi python.syntax sequences ;
IN: python.throwing
ERROR: python-error type message traceback ;
PY-FROM: traceback => format_tb ( tb -- seq ) ;
PY-METHODS: obj =>