Using internal functions
Posted: Wed Nov 16, 2016 8:46 pm
If I'm writing a module - lets say I want to write a function that takes two python strings and joins them - ( I know I can do this using str.join - but I'm trying to learn how things work under the hood)
there is already a function to do that in objstr.c called str_join
it looks like I'm supposed to access it somehow using str_join_obj - but I can't find any examples of how these things get called.
It looks like MP_DEFINE_CONST_FUN_OBJ_2(str_join_obj, str_join) would set up a struct that has a pointer to the actual function and then
I should call it with something like fun_builtin_2_call from objfun.c - but I can't find any places that actually use this.
Would anyone have a code snippet or a good place to look to find a builtin function that then uses other builtin functions - preferably string functions so I can just "play" with it
Thanks,
Kelly
there is already a function to do that in objstr.c called str_join
it looks like I'm supposed to access it somehow using str_join_obj - but I can't find any examples of how these things get called.
It looks like MP_DEFINE_CONST_FUN_OBJ_2(str_join_obj, str_join) would set up a struct that has a pointer to the actual function and then
I should call it with something like fun_builtin_2_call from objfun.c - but I can't find any places that actually use this.
Would anyone have a code snippet or a good place to look to find a builtin function that then uses other builtin functions - preferably string functions so I can just "play" with it
Thanks,
Kelly