Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
620 changes: 310 additions & 310 deletions cpython/pkg.generated.mbti

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cpython/utils.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ priv trait ToCStr {
impl ToCStr for String with to_cstr(self) {
let s = @encoding/utf8.encode(self).to_array().filter(fn(c) { c != 0 })
s.push(0)
s |> @bytes.from_array
s |> Bytes::from_array
}
4 changes: 2 additions & 2 deletions dict.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn PyDict::op_get(self : PyDict, key : String) -> PyObjectEnum {
/// ..set("one", PyInteger::from(1))
/// ..set("two", PyFloat::from(2.0))
/// ..set("three", PyBool::from(true));
///
///
/// inspect(dict, content="{\'one\': 1, \'two\': 2.0, \'three\': True}")
/// ```
///
Expand Down Expand Up @@ -225,7 +225,7 @@ pub fn[K : IsPyObject, V : IsPyObject] PyDict::setByObj(
/// dict["one"] = PyInteger::from(1);
/// dict["two"] = PyFloat::from(2.0);
/// dict["three"] = PyBool::from(true);
///
///
/// inspect(dict, content="{\'one\': 1, \'two\': 2.0, \'three\': True}")
/// ```
///
Expand Down
240 changes: 120 additions & 120 deletions pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -6,145 +6,145 @@ import(
)

// Values
fn init_py() -> Unit
pub fn init_py() -> Unit

fn pyimport(String, print_err? : Bool) -> PyModule?
pub fn pyimport(String, print_err? : Bool) -> PyModule?

fn strip_quot(String) -> String
pub fn strip_quot(String) -> String

// Errors
pub suberror PyRuntimeError {
TypeMisMatchError
TypeMismatchError
IndexOutOfBoundsError
KeyIsUnHashableError
InVokeError
}
impl Show for PyRuntimeError
pub impl Show for PyRuntimeError

// Types and methods
pub struct PyBool {
// private fields
}
fn PyBool::create(PyObject) -> Self raise PyRuntimeError
fn PyBool::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyBool::dump(Self) -> Unit
fn PyBool::from(Bool) -> Self
fn PyBool::is_false(Self) -> Bool
fn PyBool::is_true(Self) -> Bool
fn PyBool::not(Self) -> Self
fn PyBool::to_bool(Self) -> Bool
impl IsPyObject for PyBool
impl Show for PyBool
pub fn PyBool::create(PyObject) -> Self raise PyRuntimeError
pub fn PyBool::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyBool::dump(Self) -> Unit
pub fn PyBool::from(Bool) -> Self
pub fn PyBool::is_false(Self) -> Bool
pub fn PyBool::is_true(Self) -> Bool
pub fn PyBool::not(Self) -> Self
pub fn PyBool::to_bool(Self) -> Bool
pub impl IsPyObject for PyBool
pub impl Show for PyBool

pub struct PyCallable {
// private fields
}
fn PyCallable::create(PyObject) -> Self raise PyRuntimeError
fn PyCallable::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyCallable::dump(Self) -> Unit
fn PyCallable::invoke(Self, args? : PyTuple, kwargs? : PyDict, print_err? : Bool) -> PyObjectEnum? raise PyRuntimeError
impl IsPyObject for PyCallable
impl Show for PyCallable
pub fn PyCallable::create(PyObject) -> Self raise PyRuntimeError
pub fn PyCallable::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyCallable::dump(Self) -> Unit
pub fn PyCallable::invoke(Self, args? : PyTuple, kwargs? : PyDict, print_err? : Bool) -> PyObjectEnum? raise PyRuntimeError
pub impl IsPyObject for PyCallable
pub impl Show for PyCallable

pub struct PyDict {
// private fields
}
fn PyDict::contains(Self, String) -> Bool
fn PyDict::containsObj(Self, PyObject) -> Bool
fn PyDict::create(PyObject) -> Self raise PyRuntimeError
fn PyDict::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyDict::drop(Self) -> Unit
fn PyDict::dump(Self) -> Unit
fn PyDict::get(Self, String) -> PyObjectEnum?
fn PyDict::getByObj(Self, PyObject) -> PyObjectEnum?
fn PyDict::items(Self) -> PyList
fn PyDict::keys(Self) -> PyList
fn PyDict::len(Self) -> Int
fn PyDict::new() -> Self
fn PyDict::op_get(Self, String) -> PyObjectEnum
fn[V : IsPyObject] PyDict::op_set(Self, String, V) -> Unit
fn[V : IsPyObject] PyDict::set(Self, String, V) -> Unit
fn[K : IsPyObject, V : IsPyObject] PyDict::setByObj(Self, K, V) -> Unit raise PyRuntimeError
fn PyDict::values(Self) -> PyList
impl IsPyObject for PyDict
impl Show for PyDict
pub fn PyDict::contains(Self, String) -> Bool
pub fn PyDict::containsObj(Self, PyObject) -> Bool
pub fn PyDict::create(PyObject) -> Self raise PyRuntimeError
pub fn PyDict::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyDict::drop(Self) -> Unit
pub fn PyDict::dump(Self) -> Unit
pub fn PyDict::get(Self, String) -> PyObjectEnum?
pub fn PyDict::getByObj(Self, PyObject) -> PyObjectEnum?
pub fn PyDict::items(Self) -> PyList
pub fn PyDict::keys(Self) -> PyList
pub fn PyDict::len(Self) -> Int
pub fn PyDict::new() -> Self
pub fn PyDict::op_get(Self, String) -> PyObjectEnum
pub fn[V : IsPyObject] PyDict::op_set(Self, String, V) -> Unit
pub fn[V : IsPyObject] PyDict::set(Self, String, V) -> Unit
pub fn[K : IsPyObject, V : IsPyObject] PyDict::setByObj(Self, K, V) -> Unit raise PyRuntimeError
pub fn PyDict::values(Self) -> PyList
pub impl IsPyObject for PyDict
pub impl Show for PyDict

pub struct PyFloat {
// private fields
}
fn PyFloat::create(PyObject) -> Self raise PyRuntimeError
fn PyFloat::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyFloat::drop(Self) -> Unit
fn PyFloat::dump(Self) -> Unit
fn PyFloat::from(Double) -> Self
fn PyFloat::to_double(Self) -> Double
impl IsPyObject for PyFloat
impl Show for PyFloat
pub fn PyFloat::create(PyObject) -> Self raise PyRuntimeError
pub fn PyFloat::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyFloat::drop(Self) -> Unit
pub fn PyFloat::dump(Self) -> Unit
pub fn PyFloat::from(Double) -> Self
pub fn PyFloat::to_double(Self) -> Double
pub impl IsPyObject for PyFloat
pub impl Show for PyFloat

pub struct PyInteger {
// private fields
}
fn PyInteger::create(PyObject) -> Self raise PyRuntimeError
fn PyInteger::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyInteger::create_unchecked(PyObject) -> Self
fn PyInteger::drop(Self) -> Unit
fn PyInteger::dump(Self) -> Unit
fn PyInteger::from(Int64) -> Self
fn PyInteger::to_double(Self) -> Double
fn PyInteger::to_int64(Self) -> Int64
impl IsPyObject for PyInteger
impl Show for PyInteger
pub fn PyInteger::create(PyObject) -> Self raise PyRuntimeError
pub fn PyInteger::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyInteger::create_unchecked(PyObject) -> Self
pub fn PyInteger::drop(Self) -> Unit
pub fn PyInteger::dump(Self) -> Unit
pub fn PyInteger::from(Int64) -> Self
pub fn PyInteger::to_double(Self) -> Double
pub fn PyInteger::to_int64(Self) -> Int64
pub impl IsPyObject for PyInteger
pub impl Show for PyInteger

pub struct PyList {
// private fields
}
fn[T : IsPyObject] PyList::append(Self, T) -> Unit
fn PyList::create(PyObject) -> Self raise PyRuntimeError
fn PyList::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyList::drop(Self) -> Unit
fn PyList::dump(Self) -> Unit
fn[T : IsPyObject] PyList::from(Array[T]) -> Self
fn PyList::get(Self, Int) -> PyObjectEnum?
fn PyList::len(Self) -> Int
fn PyList::new() -> Self
fn PyList::op_get(Self, Int) -> PyObjectEnum
fn[T : IsPyObject] PyList::op_set(Self, Int, T) -> Unit
fn[T : IsPyObject] PyList::set(Self, Int, T) -> Unit raise PyRuntimeError
impl IsPyObject for PyList
impl Show for PyList
pub fn[T : IsPyObject] PyList::append(Self, T) -> Unit
pub fn PyList::create(PyObject) -> Self raise PyRuntimeError
pub fn PyList::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyList::drop(Self) -> Unit
pub fn PyList::dump(Self) -> Unit
pub fn[T : IsPyObject] PyList::from(Array[T]) -> Self
pub fn PyList::get(Self, Int) -> PyObjectEnum?
pub fn PyList::len(Self) -> Int
pub fn PyList::new() -> Self
pub fn PyList::op_get(Self, Int) -> PyObjectEnum
pub fn[T : IsPyObject] PyList::op_set(Self, Int, T) -> Unit
pub fn[T : IsPyObject] PyList::set(Self, Int, T) -> Unit raise PyRuntimeError
pub impl IsPyObject for PyList
pub impl Show for PyList

pub struct PyModule {
// private fields
}
fn PyModule::create(PyObject) -> Self raise PyRuntimeError
fn PyModule::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyModule::dump(Self) -> Unit
fn PyModule::get_attr(Self, String, print_err? : Bool) -> PyObjectEnum?
fn PyModule::get_name(Self) -> String
impl IsPyObject for PyModule
impl Show for PyModule
pub fn PyModule::create(PyObject) -> Self raise PyRuntimeError
pub fn PyModule::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyModule::dump(Self) -> Unit
pub fn PyModule::get_attr(Self, String, print_err? : Bool) -> PyObjectEnum?
pub fn PyModule::get_name(Self) -> String
pub impl IsPyObject for PyModule
pub impl Show for PyModule

pub struct PyObject {
// private fields
}
fn PyObject::create(@cpython.PyObjectRef) -> Self
fn PyObject::drop(Self) -> Unit
fn PyObject::dump(Self) -> Unit
fn PyObject::get_attr(Self, String, print_err? : Bool) -> PyObjectEnum?
fn PyObject::is_bool(Self) -> Bool
fn PyObject::is_callable(Self) -> Bool
fn PyObject::is_dict(Self) -> Bool
fn PyObject::is_float(Self) -> Bool
fn PyObject::is_int(Self) -> Bool
fn PyObject::is_list(Self) -> Bool
fn PyObject::is_module(Self) -> Bool
fn PyObject::is_null(Self) -> Bool
fn PyObject::is_string(Self) -> Bool
fn PyObject::is_tuple(Self) -> Bool
fn PyObject::type_name(Self) -> String
fn PyObject::type_of(Self) -> PyType
impl IsPyObject for PyObject
impl Show for PyObject
pub fn PyObject::create(@cpython.PyObjectRef) -> Self
pub fn PyObject::drop(Self) -> Unit
pub fn PyObject::dump(Self) -> Unit
pub fn PyObject::get_attr(Self, String, print_err? : Bool) -> PyObjectEnum?
pub fn PyObject::is_bool(Self) -> Bool
pub fn PyObject::is_callable(Self) -> Bool
pub fn PyObject::is_dict(Self) -> Bool
pub fn PyObject::is_float(Self) -> Bool
pub fn PyObject::is_int(Self) -> Bool
pub fn PyObject::is_list(Self) -> Bool
pub fn PyObject::is_module(Self) -> Bool
pub fn PyObject::is_null(Self) -> Bool
pub fn PyObject::is_string(Self) -> Bool
pub fn PyObject::is_tuple(Self) -> Bool
pub fn PyObject::type_name(Self) -> String
pub fn PyObject::type_of(Self) -> PyType
pub impl IsPyObject for PyObject
pub impl Show for PyObject

pub(all) enum PyObjectEnum {
PyInteger(PyInteger)
Expand All @@ -158,37 +158,37 @@ pub(all) enum PyObjectEnum {
PyCallable(PyCallable)
PyClass(PyObject)
}
fn PyObjectEnum::create(PyObject) -> Self
fn PyObjectEnum::create_by_ref(@cpython.PyObjectRef) -> Self
fn PyObjectEnum::dump(Self) -> Unit
impl Show for PyObjectEnum
pub fn PyObjectEnum::create(PyObject) -> Self
pub fn PyObjectEnum::create_by_ref(@cpython.PyObjectRef) -> Self
pub fn PyObjectEnum::dump(Self) -> Unit
pub impl Show for PyObjectEnum

pub struct PyString {
// private fields
}
fn PyString::create(PyObject) -> Self raise PyRuntimeError
fn PyString::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyString::drop(Self) -> Unit
fn PyString::dump(Self) -> Unit
fn PyString::from(String) -> Self
impl IsPyObject for PyString
impl Show for PyString
pub fn PyString::create(PyObject) -> Self raise PyRuntimeError
pub fn PyString::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyString::drop(Self) -> Unit
pub fn PyString::dump(Self) -> Unit
pub fn PyString::from(String) -> Self
pub impl IsPyObject for PyString
pub impl Show for PyString

pub struct PyTuple {
// private fields
}
fn PyTuple::create(PyObject) -> Self raise PyRuntimeError
fn PyTuple::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
fn PyTuple::drop(Self) -> Unit
fn PyTuple::dump(Self) -> Unit
fn PyTuple::get(Self, Int) -> PyObjectEnum?
fn PyTuple::len(Self) -> UInt64
fn PyTuple::new(UInt64) -> Self
fn PyTuple::op_get(Self, Int) -> PyObjectEnum
fn[T : IsPyObject] PyTuple::op_set(Self, Int, T) -> Unit
fn[T : IsPyObject] PyTuple::set(Self, Int, T) -> Unit
impl IsPyObject for PyTuple
impl Show for PyTuple
pub fn PyTuple::create(PyObject) -> Self raise PyRuntimeError
pub fn PyTuple::create_by_ref(@cpython.PyObjectRef) -> Self raise PyRuntimeError
pub fn PyTuple::drop(Self) -> Unit
pub fn PyTuple::dump(Self) -> Unit
pub fn PyTuple::get(Self, Int) -> PyObjectEnum?
pub fn PyTuple::len(Self) -> UInt64
pub fn PyTuple::new(UInt64) -> Self
pub fn PyTuple::op_get(Self, Int) -> PyObjectEnum
pub fn[T : IsPyObject] PyTuple::op_set(Self, Int, T) -> Unit
pub fn[T : IsPyObject] PyTuple::set(Self, Int, T) -> Unit
pub impl IsPyObject for PyTuple
pub impl Show for PyTuple

pub enum PyType {
PyInteger
Expand Down
1 change: 0 additions & 1 deletion set.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

22 changes: 11 additions & 11 deletions time/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
package "Kaida-Amethyst/python/time"

// Values
fn ctime(Double?) -> String
pub fn ctime(Double?) -> String

fn monotonic() -> Double
pub fn monotonic() -> Double

fn monotonic_ns() -> Int64
pub fn monotonic_ns() -> Int64

fn perf_counter() -> Double
pub fn perf_counter() -> Double

fn perf_counter_ns() -> Int64
pub fn perf_counter_ns() -> Int64

fn process_time() -> Double
pub fn process_time() -> Double

fn process_time_ns() -> Int64
pub fn process_time_ns() -> Int64

fn sleep(Double) -> Unit
pub fn sleep(Double) -> Unit

fn time() -> Double
pub fn time() -> Double

fn time_ns() -> Int64
pub fn time_ns() -> Int64

// Errors
pub suberror TurtleError {
LoadTimeModuleError
}
impl Show for TurtleError
pub impl Show for TurtleError

// Types and methods
pub struct TimeModule {
Expand Down
Loading
Loading