Add List.extend and List.to_list, plus some more tests

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-09-30 19:53:31 -07:00
parent a370d3a56f
commit a7d7d8e564
4 changed files with 110 additions and 4 deletions

View File

@@ -190,6 +190,7 @@ pub fn init_types() {
List {
// Conversion methods
to_repr => BuiltinFunction::create("to_repr", List::to_repr, 1),
to_list => BuiltinFunction::create("to_list", List::to_list, 1),
// Constructor
__call__ => BuiltinFunction::create("__call__", List::do_call, 2),
@@ -203,6 +204,7 @@ pub fn init_types() {
push => BuiltinFunction::create("push", List::push, 2),
pop => BuiltinFunction::create("pop", List::pop, 1),
extend => BuiltinFunction::create("extend", List::extend, 2),
},
Str {
// Conversion methods