Skip to content
Closed
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
13 changes: 13 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[files]
extend-exclude = ["**/*_gen.mbt"]

[default.extend-identifiers]
IDentifier = "IDentifier"

[default]
extend-ignore-re = [
# ignore string literals
"pen.ba\\(distance\\)",
"\"(.*?)\"",
".*#|.*",
]
8 changes: 4 additions & 4 deletions bool.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ pub struct PyBool {
}

///| Create a python boolean object from a python object.
/// If the object is not a boolean, it will raise a TypeMisMatchError.
/// If the object is not a boolean, it will raise a TypeMismatchError.
pub fn PyBool::create(obj : PyObject) -> PyBool raise PyRuntimeError {
guard obj.is_bool() else { raise TypeMisMatchError }
guard obj.is_bool() else { raise TypeMismatchError }
PyBool::{ obj, }
}

Expand All @@ -20,11 +20,11 @@ fn PyBool::create_unchecked(obj : PyObject) -> PyBool {
}

///| Create a python boolean object from a python object reference.
/// If the object is not a boolean, it will raise a TypeMisMatchError.
/// If the object is not a boolean, it will raise a TypeMismatchError.
pub fn PyBool::create_by_ref(
obj_ref : @cpython.PyObjectRef,
) -> PyBool raise PyRuntimeError {
guard @cpython.py_bool_check(obj_ref) else { raise TypeMisMatchError }
guard @cpython.py_bool_check(obj_ref) else { raise TypeMismatchError }
PyBool::{ obj: PyObject::create(obj_ref) }
}

Expand Down
8 changes: 4 additions & 4 deletions callable.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ pub struct PyCallable {
}

///| Create a python callable object from a PyObject.
/// If the object is not callable, a TypeMisMatchError is raised.
/// If the object is not callable, a TypeMismatchError is raised.
pub fn PyCallable::create(obj : PyObject) -> PyCallable raise PyRuntimeError {
guard obj.is_callable() else { raise TypeMisMatchError }
guard obj.is_callable() else { raise TypeMismatchError }
PyCallable::{ obj, }
}

Expand All @@ -20,11 +20,11 @@ fn PyCallable::create_unchecked(obj : PyObject) -> PyCallable {
}

///| Create a python callable object from a PyObjectRef.
/// If the object is not callable, a TypeMisMatchError is raised.
/// If the object is not callable, a TypeMismatchError is raised.
pub fn PyCallable::create_by_ref(
obj : @cpython.PyObjectRef,
) -> PyCallable raise PyRuntimeError {
guard @cpython.py_callable_check(obj) else { raise TypeMisMatchError }
guard @cpython.py_callable_check(obj) else { raise TypeMismatchError }
PyCallable::{ obj: PyObject::create(obj) }
}

Expand Down
8 changes: 4 additions & 4 deletions dict.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ pub struct PyDict {
}

///| Create a python dict object.
/// If the python object is not a dict, it will raise a TypeMisMatchError.
/// If the python object is not a dict, it will raise a TypeMismatchError.
pub fn PyDict::create(obj : PyObject) -> PyDict raise PyRuntimeError {
guard obj.is_dict() else { raise TypeMisMatchError }
guard obj.is_dict() else { raise TypeMismatchError }
PyDict::{ obj, }
}

Expand All @@ -20,11 +20,11 @@ fn PyDict::create_unchecked(obj : PyObject) -> PyDict {
}

///| Create a python dict object from a python object reference.
/// If the python object is not a dict, it will raise a TypeMisMatchError.
/// If the python object is not a dict, it will raise a TypeMismatchError.
pub fn PyDict::create_by_ref(
obj : @cpython.PyObjectRef,
) -> PyDict raise PyRuntimeError {
guard @cpython.py_dict_check(obj) else { raise TypeMisMatchError }
guard @cpython.py_dict_check(obj) else { raise TypeMismatchError }
PyDict::{ obj: PyObject::create(obj) }
}

Expand Down
2 changes: 1 addition & 1 deletion errors.mbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///|
pub suberror PyRuntimeError {
TypeMisMatchError
TypeMismatchError
IndexOutOfBoundsError
KeyIsUnHashableError
InVokeError
Expand Down
12 changes: 6 additions & 6 deletions float.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pub struct PyFloat {
}

///| Create a python float object from a python object.
/// If the python object is not a float, it will raise a TypeMisMatchError.
/// If the python object is not a float, it will raise a TypeMismatchError.
pub fn PyFloat::create(obj : PyObject) -> PyFloat raise PyRuntimeError {
guard obj.is_float() else { raise TypeMisMatchError }
guard obj.is_float() else { raise TypeMismatchError }
PyFloat::{ obj, }
}

Expand All @@ -15,12 +15,12 @@ fn PyFloat::create_unchecked(obj : PyObject) -> PyFloat {
PyFloat::{ obj, }
}

///| Ceate a python float object from a python object reference.
/// If the python object is not a float, it will raise a TypeMisMatchError.
///| Create a python float object from a python object reference.
/// If the python object is not a float, it will raise a TypeMismatchError.
pub fn PyFloat::create_by_ref(
obj : @cpython.PyObjectRef,
) -> PyFloat raise PyRuntimeError {
guard @cpython.py_float_check(obj) else { raise TypeMisMatchError }
guard @cpython.py_float_check(obj) else { raise TypeMismatchError }
PyFloat::{ obj: PyObject::create(obj) }
}

Expand Down Expand Up @@ -58,7 +58,7 @@ pub fn PyFloat::to_double(self : PyFloat) -> Double {
@cpython.py_float_as_double(self.obj_ref())
}

///| Print the PyFloat object direcly.
///| Print the PyFloat object directly.
///
/// Different from use `println`, `dump` means we made python interpreter
/// print the object directly.
Expand Down
6 changes: 3 additions & 3 deletions integer.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct PyInteger {
///| Create a python integer object from a python object.
/// If
pub fn PyInteger::create(obj : PyObject) -> PyInteger raise PyRuntimeError {
guard obj.is_int() else { raise TypeMisMatchError }
guard obj.is_int() else { raise TypeMismatchError }
PyInteger::{ obj, }
}

Expand All @@ -23,7 +23,7 @@ pub fn PyInteger::create_unchecked(obj : PyObject) -> PyInteger {
pub fn PyInteger::create_by_ref(
obj : @cpython.PyObjectRef,
) -> PyInteger raise PyRuntimeError {
guard @cpython.py_int_check(obj) else { raise TypeMisMatchError }
guard @cpython.py_int_check(obj) else { raise TypeMismatchError }
PyInteger::{ obj: PyObject::create(obj) }
}

Expand Down Expand Up @@ -73,7 +73,7 @@ pub fn PyInteger::to_double(self : PyInteger) -> Double {
@cpython.py_long_as_double(self.obj_ref())
}

///| Print the PyInteger object direcly.
///| Print the PyInteger object directly.
///
/// Different from use `println`, `dump` means we made python interpreter
/// print the object directly.
Expand Down
8 changes: 4 additions & 4 deletions list.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub fn PyList::new() -> PyList {
}

///| Create a python list object from a pyobject.
/// If the pyobject is not a list, it will raise a TypeMisMatchError.
/// If the pyobject is not a list, it will raise a TypeMismatchError.
pub fn PyList::create(obj : PyObject) -> PyList raise PyRuntimeError {
guard obj.is_list() else { raise TypeMisMatchError }
guard obj.is_list() else { raise TypeMismatchError }
PyList::{ obj, }
}

Expand All @@ -33,11 +33,11 @@ fn PyList::create_unchecked(obj : PyObject) -> PyList {
}

///| Create a python list object from a pyobject reference.
/// If the pyobject is not a list, it will raise a TypeMisMatchError.
/// If the pyobject is not a list, it will raise a TypeMismatchError.
pub fn PyList::create_by_ref(
obj : @cpython.PyObjectRef,
) -> PyList raise PyRuntimeError {
guard @cpython.py_list_check(obj) else { raise TypeMisMatchError }
guard @cpython.py_list_check(obj) else { raise TypeMismatchError }
PyList::{ obj: PyObject::create(obj) }
}

Expand Down
4 changes: 2 additions & 2 deletions module.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct PyModule {

///|
pub fn PyModule::create(obj : PyObject) -> PyModule raise PyRuntimeError {
guard obj.is_module() else { raise TypeMisMatchError }
guard obj.is_module() else { raise TypeMismatchError }
PyModule::{ obj, name: None, attrs: Map::new() }
}

Expand All @@ -24,7 +24,7 @@ fn PyModule::create_unchecked(obj : PyObject) -> PyModule {
pub fn PyModule::create_by_ref(
obj_ref : @cpython.PyObjectRef,
) -> PyModule raise PyRuntimeError {
guard @cpython.py_module_check(obj_ref) else { raise TypeMisMatchError }
guard @cpython.py_module_check(obj_ref) else { raise TypeMismatchError }
PyModule::{ obj: PyObject::create(obj_ref), name: None, attrs: Map::new() }
}

Expand Down
2 changes: 1 addition & 1 deletion python.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn strip_quot(String) -> String

// Errors
pub suberror PyRuntimeError {
TypeMisMatchError
TypeMismatchError
IndexOutOfBoundsError
KeyIsUnHashableError
InVokeError
Expand Down
10 changes: 5 additions & 5 deletions str.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ pub struct PyString {
}

///| Create a python string from a python object.
/// If the python object is not a string, it will raise a TypeMisMatchError.
/// If the python object is not a string, it will raise a TypeMismatchError.
pub fn PyString::create(obj : PyObject) -> PyString raise PyRuntimeError {
guard obj.is_string() else { raise TypeMisMatchError }
guard obj.is_string() else { raise TypeMismatchError }
PyString::{ obj, }
}

Expand All @@ -20,11 +20,11 @@ fn PyString::create_unchecked(obj : PyObject) -> PyString {
}

///| Create a python string from a python object reference.
///If the python object is not a string, it will raise a TypeMisMatchError.
///If the python object is not a string, it will raise a TypeMismatchError.
pub fn PyString::create_by_ref(
obj_ref : @cpython.PyObjectRef,
) -> PyString raise PyRuntimeError {
guard @cpython.py_string_check(obj_ref) else { raise TypeMisMatchError }
guard @cpython.py_string_check(obj_ref) else { raise TypeMismatchError }
PyString::{ obj: PyObject::create(obj_ref) }
}

Expand Down Expand Up @@ -54,7 +54,7 @@ pub fn PyString::from(s : String) -> PyString {
}
}

///| Print the PyString object direcly.
///| Print the PyString object directly.
///
/// Different from use `println`, `dump` means we made python interpreter
/// print the object directly.
Expand Down
8 changes: 4 additions & 4 deletions tuple.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub fn PyTuple::new(size : UInt64) -> PyTuple {
}

///| Create a PyTuple object from a python object.
/// If the python object is not a tuple, it will raise a TypeMisMatchError.
/// If the python object is not a tuple, it will raise a TypeMismatchError.
pub fn PyTuple::create(obj : PyObject) -> PyTuple raise PyRuntimeError {
guard obj.is_tuple() else { raise TypeMisMatchError }
guard obj.is_tuple() else { raise TypeMismatchError }
PyTuple::{ obj, }
}

Expand All @@ -39,11 +39,11 @@ fn PyTuple::create_unchecked(obj : PyObject) -> PyTuple {
}

///| Create a PyTuple object from a python object reference.
/// If the python object is not a tuple, it will raise a TypeMisMatchError.
/// If the python object is not a tuple, it will raise a TypeMismatchError.
pub fn PyTuple::create_by_ref(
obj_ref : @cpython.PyObjectRef,
) -> PyTuple raise PyRuntimeError {
guard @cpython.py_tuple_check(obj_ref) else { raise TypeMisMatchError }
guard @cpython.py_tuple_check(obj_ref) else { raise TypeMismatchError }
PyTuple::{ obj: PyObject::create(obj_ref) }
}

Expand Down
Loading