@@ -15,7 +15,7 @@ use super::pystr::PyStrRef;
15
15
use super :: staticmethod:: PyStaticMethod ;
16
16
use super :: tuple:: PyTuple ;
17
17
use super :: weakref:: PyWeak ;
18
- use crate :: builtins:: tuple:: PyTupleRef ;
18
+ use crate :: builtins:: tuple:: { PyTupleRef , PyTupleTyped } ;
19
19
use crate :: function:: { FuncArgs , KwArgs } ;
20
20
use crate :: pyobject:: {
21
21
BorrowValue , Either , IdProtocol , PyAttributes , PyClassImpl , PyContext , PyIterable , PyLease ,
@@ -418,13 +418,10 @@ impl PyType {
418
418
} ) ) ;
419
419
}
420
420
421
- let ( name, bases, dict, kwargs) : ( PyStrRef , PyTupleRef , PyDictRef , KwArgs ) =
421
+ let ( name, bases, dict, kwargs) : ( PyStrRef , PyTupleTyped < PyTypeRef > , PyDictRef , KwArgs ) =
422
422
args. clone ( ) . bind ( vm) ?;
423
423
424
- // TODO: This is kind of a hack because we lose type information only to redo it
425
- let bases: PyIterable < PyTypeRef > =
426
- PyIterable :: try_from_object ( vm, bases. into_object ( ) ) . unwrap ( ) ;
427
- let bases: Vec < PyTypeRef > = bases. iter ( vm) ?. collect :: < Result < Vec < _ > , _ > > ( ) ?;
424
+ let bases = bases. borrow_value ( ) . iter ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
428
425
let ( metatype, base, bases) = if bases. is_empty ( ) {
429
426
let base = vm. ctx . types . object_type . clone ( ) ;
430
427
( metatype, base. clone ( ) , vec ! [ base] )
0 commit comments