@@ -7,7 +7,11 @@ use crate::inspect::types::TypeInfo;
77use crate :: inspect:: TypeHint ;
88use crate :: pyclass:: boolean_struct:: False ;
99use crate :: pyclass:: { PyClassGuardError , PyClassGuardMutError } ;
10+ #[ cfg( feature = "experimental-inspect" ) ]
11+ use crate :: type_object:: PyTypeInfo ;
1012use crate :: types:: PyTuple ;
13+ #[ cfg( feature = "experimental-inspect" ) ]
14+ use crate :: types:: { PyList , PySequence } ;
1115use crate :: {
1216 Borrowed , Bound , BoundObject , Py , PyAny , PyClass , PyClassGuard , PyErr , PyRef , PyRefMut , Python ,
1317} ;
@@ -109,6 +113,12 @@ pub trait IntoPyObject<'py>: Sized {
109113 let list = crate :: types:: list:: try_new_from_iter ( py, & mut iter) ;
110114 list. map ( Bound :: into_any)
111115 }
116+
117+ /// The output type of [`owned_sequence_into_pyobject`] and [`borrowed_sequence_into_pyobject`]
118+ #[ cfg( feature = "experimental-inspect" ) ]
119+ #[ doc( hidden) ]
120+ const SEQUENCE_OUTPUT_TYPE : TypeHint =
121+ TypeHint :: subscript ( & PyList :: TYPE_HINT , & [ Self :: OUTPUT_TYPE ] ) ;
112122}
113123
114124pub ( crate ) mod private {
@@ -436,6 +446,12 @@ pub trait FromPyObject<'a, 'py>: Sized {
436446 Option :: < NeverASequence < Self > > :: None
437447 }
438448
449+ /// The union of Sequence[Self::INPUT_TYPE] and the input sequence extraction function [`sequence_extractor`] if it's defined
450+ #[ cfg( feature = "experimental-inspect" ) ]
451+ #[ doc( hidden) ]
452+ const SEQUENCE_INPUT_TYPE : TypeHint =
453+ TypeHint :: subscript ( & PySequence :: TYPE_HINT , & [ Self :: INPUT_TYPE ] ) ;
454+
439455 /// Helper used to make a specialized path in extracting `DateTime<Tz>` where `Tz` is
440456 /// `chrono::Local`, which will accept "naive" datetime objects as being in the local timezone.
441457 #[ cfg( feature = "chrono-local" ) ]
0 commit comments