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.capture_python_error : PythonErrorInfo | Nil #

Capture and clear the current Python exception while the GIL is held.


[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 in the shared main namespace.


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

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

Execute Python statements in the shared main namespace.


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

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

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

[View source]
def self.init(python_executable : String | Nil = nil) : Nil #

Initialize CPython once for this process. Attaching to an interpreter initialized by another library is deliberately unsupported.


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

Whether the Crython-managed CPython runtime is available.


[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.slice_full : PyObject #

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

Crython currently supports only the OS thread that initialized CPython.


[View source]