mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
...
This commit is contained in:
parent
651bf997fc
commit
3fbbd9fb67
File diff suppressed because one or more lines are too long
@ -90,6 +90,11 @@ static bool type__name__getter(int argc, py_Ref argv) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool type__getitem__(int argc, py_Ref argv) {
|
||||||
|
py_assign(py_retval(), argv);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void pk_object__register() {
|
void pk_object__register() {
|
||||||
// TODO: use staticmethod
|
// TODO: use staticmethod
|
||||||
py_bindmagic(tp_object, __new__, object__new__);
|
py_bindmagic(tp_object, __new__, object__new__);
|
||||||
@ -102,6 +107,7 @@ void pk_object__register() {
|
|||||||
|
|
||||||
py_bindmagic(tp_type, __repr__, type__repr__);
|
py_bindmagic(tp_type, __repr__, type__repr__);
|
||||||
py_bindmagic(tp_type, __new__, type__new__);
|
py_bindmagic(tp_type, __new__, type__new__);
|
||||||
|
py_bindmagic(tp_type, __getitem__, type__getitem__);
|
||||||
|
|
||||||
py_bindproperty(tp_type, "__base__", type__base__getter, NULL);
|
py_bindproperty(tp_type, "__base__", type__base__getter, NULL);
|
||||||
py_bindproperty(tp_type, "__name__", type__name__getter, NULL);
|
py_bindproperty(tp_type, "__name__", type__name__getter, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user