-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpython.mbti
More file actions
214 lines (194 loc) · 6.09 KB
/
Copy pathpython.mbti
File metadata and controls
214 lines (194 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Generated using `moon info`, DON'T EDIT IT
package "Kaida-Amethyst/python"
import(
"Kaida-Amethyst/python/cpython"
)
// Values
fn init_py() -> Unit
fn pyimport(String, print_err? : Bool) -> PyModule?
fn strip_quot(String) -> String
// Errors
pub suberror PyRuntimeError {
TypeMisMatchError
IndexOutOfBoundsError
KeyIsUnHashableError
InVokeError
}
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 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 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 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 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 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 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 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(all) enum PyObjectEnum {
PyInteger(PyInteger)
PyFloat(PyFloat)
PyBool(PyBool)
PyString(PyString)
PyTuple(PyTuple)
PyList(PyList)
PyDict(PyDict)
PyModule(PyModule)
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 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 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 enum PyType {
PyInteger
PyFloat
PyBool
PyString
PyTuple
PyList
PyDict
PyModule
PyCallable
PyClass
}
// Type aliases
// Traits
pub trait IsPyObject {
obj(Self) -> PyObject
obj_ref(Self) -> @cpython.PyObjectRef
type_name(Self) -> String
}