{ $examples
{ $example
"USING: arrays prettyprint python sequences ;"
- "py-initialize 10 iota >array >py py> ."
+ "10 iota >array >py py> ."
"{ 0 1 2 3 4 5 6 7 8 9 }"
}
}
-USING: accessors alien alien.c-types alien.data alien.strings arrays assocs
-command-line fry hashtables io.encodings.utf8 kernel namespaces python.errors
-python.ffi python.objects sequences specialized-arrays strings vectors ;
+USING: alien.c-types alien.data arrays assocs command-line fry
+hashtables init io.encodings.utf8 kernel namespaces
+python.errors python.ffi python.objects sequences
+specialized-arrays strings vectors ;
IN: python
QUALIFIED: math
: py> ( py-obj -- obj )
dup "__class__" getattr "__name__" getattr PyString_AsString
py-type-dispatch get ?at [ call( x -- x ) ] [ missing-type ] if ;
+
+[ py-initialize ] "py-initialize" add-startup-hook
+[ py-finalize ] "py-finalize" add-shutdown-hook