module Crython

Defined in:

crython.cr
crython/env.cr
crython/error.cr
crython/libpython.cr
crython/libpython/abstract.cr
crython/libpython/boolobject.cr
crython/libpython/ceval.cr
crython/libpython/complexobject.cr
crython/libpython/dictobject.cr
crython/libpython/floatobject.cr
crython/libpython/import.cr
crython/libpython/listobject.cr
crython/libpython/longobject.cr
crython/libpython/modsupport.cr
crython/libpython/pyerrors.cr
crython/libpython/pylifecycle.cr
crython/libpython/pystate.cr
crython/libpython/pythonrun.cr
crython/libpython/refcount.cr
crython/libpython/setobject.cr
crython/libpython/sliceobject.cr
crython/libpython/tupleobject.cr
crython/libpython/unicodeobject.cr
crython/py2cr/basic.cr
crython/py2cr/collections.cr
crython/pyobject.cr
crython/pyobject/object_protocol.cr
crython/version.cr

Constant Summary

PY_EVAL_INPUT = 258
PY_FILE_INPUT = 257
PY_SINGLE_INPUT = 256
VERSION = {{ (`shards version /home/runner/work/crython/crython/src/crython`).chomp.stringify }}

Class Method Summary

Class Method Detail

def self.active_session?(token : SessionToken) : Bool #

Check if the current session is active


[View source]
def self.clear_error #

Clear the current Python error state


[View source]
def self.debug_enabled? : Bool #

[View source]
def self.debug_log(message : String) : Nil #

[View source]
def self.err_occurred? : Bool #

Whether the Python interpreter raised an error.


[View source]
def self.eval(code : String) : PyObject #

Evaluate a Python expression and return the result as PyObject.


[View source]
def self.eval_preview(code : String) : String #

[View source]
def self.exec(code : String) : Nil #

Execute Python statements with error handling.


[View source]
def self.extract_python_error : String | Nil #

Helper method to extract Python error information


[View source]
def self.finalize #

Finalize Crython logical session


[View source]
def self.import(name : String) : PyObject #

[View source]
def self.import?(name : String) : PyObject | Nil #

[View source]
def self.init #

Initialize a Python interpreter


[View source]
def self.initialized? : Bool #

Check if Crython logical session is initialized


[View source]
def self.none_newref : LibPython::PyObject #

Get a new reference to Python None without using varargs APIs.


[View source]
def self.python_build_info : String #

[View source]
def self.python_compiler : String #

[View source]
def self.python_version : String #

Python environment information (cached)


[View source]
def self.sealed_session?(token : SessionToken) : Bool #

[View source]
def self.session(&) #

Embed Python execution


[View source]
def self.session_token : SessionToken #

[View source]
def self.slice_full : PyObject #

[View source]
def self.with_gil(&) #

[View source]