@@ -2,8 +2,6 @@ use crate::conversion::private::Reference;
22use crate :: conversion:: { FromPyObjectSequence , IntoPyObject } ;
33use crate :: ffi_ptr_ext:: FfiPtrExt ;
44#[ cfg( feature = "experimental-inspect" ) ]
5- use crate :: inspect:: types:: TypeInfo ;
6- #[ cfg( feature = "experimental-inspect" ) ]
75use crate :: inspect:: PyStaticExpr ;
86use crate :: py_result_ext:: PyResultExt ;
97#[ cfg( feature = "experimental-inspect" ) ]
@@ -33,11 +31,6 @@ macro_rules! int_fits_larger_int {
3331 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
3432 ( self as $larger_type) . into_pyobject( py)
3533 }
36-
37- #[ cfg( feature = "experimental-inspect" ) ]
38- fn type_output( ) -> TypeInfo {
39- <$larger_type>:: type_output( )
40- }
4134 }
4235
4336 impl <' py> IntoPyObject <' py> for & $rust_type {
@@ -51,11 +44,6 @@ macro_rules! int_fits_larger_int {
5144 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
5245 ( * self ) . into_pyobject( py)
5346 }
54-
55- #[ cfg( feature = "experimental-inspect" ) ]
56- fn type_output( ) -> TypeInfo {
57- <$larger_type>:: type_output( )
58- }
5947 }
6048
6149 impl FromPyObject <' _, ' _> for $rust_type {
@@ -69,11 +57,6 @@ macro_rules! int_fits_larger_int {
6957 <$rust_type>:: try_from( val)
7058 . map_err( |e| exceptions:: PyOverflowError :: new_err( e. to_string( ) ) )
7159 }
72-
73- #[ cfg( feature = "experimental-inspect" ) ]
74- fn type_input( ) -> TypeInfo {
75- <$larger_type>:: type_input( )
76- }
7760 }
7861 } ;
7962}
@@ -120,11 +103,6 @@ macro_rules! int_convert_u64_or_i64 {
120103 . cast_into_unchecked( ) )
121104 }
122105 }
123-
124- #[ cfg( feature = "experimental-inspect" ) ]
125- fn type_output( ) -> TypeInfo {
126- TypeInfo :: builtin( "int" )
127- }
128106 }
129107 impl <' py> IntoPyObject <' py> for & $rust_type {
130108 type Target = PyInt ;
@@ -148,11 +126,6 @@ macro_rules! int_convert_u64_or_i64 {
148126 fn extract( obj: Borrowed <' _, ' _, PyAny >) -> Result <$rust_type, Self :: Error > {
149127 extract_int!( obj, !0 , $pylong_as_ll_or_ull, $force_index_call)
150128 }
151-
152- #[ cfg( feature = "experimental-inspect" ) ]
153- fn type_input( ) -> TypeInfo {
154- Self :: type_output( )
155- }
156129 }
157130 } ;
158131}
@@ -174,11 +147,6 @@ macro_rules! int_fits_c_long {
174147 . cast_into_unchecked( ) )
175148 }
176149 }
177-
178- #[ cfg( feature = "experimental-inspect" ) ]
179- fn type_output( ) -> TypeInfo {
180- TypeInfo :: builtin( "int" )
181- }
182150 }
183151
184152 impl <' py> IntoPyObject <' py> for & $rust_type {
@@ -193,11 +161,6 @@ macro_rules! int_fits_c_long {
193161 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
194162 ( * self ) . into_pyobject( py)
195163 }
196-
197- #[ cfg( feature = "experimental-inspect" ) ]
198- fn type_output( ) -> TypeInfo {
199- TypeInfo :: builtin( "int" )
200- }
201164 }
202165
203166 impl <' py> FromPyObject <' _, ' py> for $rust_type {
@@ -211,11 +174,6 @@ macro_rules! int_fits_c_long {
211174 <$rust_type>:: try_from( val)
212175 . map_err( |e| exceptions:: PyOverflowError :: new_err( e. to_string( ) ) )
213176 }
214-
215- #[ cfg( feature = "experimental-inspect" ) ]
216- fn type_input( ) -> TypeInfo {
217- Self :: type_output( )
218- }
219177 }
220178 } ;
221179}
@@ -236,11 +194,6 @@ impl<'py> IntoPyObject<'py> for u8 {
236194 }
237195 }
238196
239- #[ cfg( feature = "experimental-inspect" ) ]
240- fn type_output ( ) -> TypeInfo {
241- TypeInfo :: builtin ( "int" )
242- }
243-
244197 #[ inline]
245198 fn owned_sequence_into_pyobject < I > (
246199 iter : I ,
@@ -269,11 +222,6 @@ impl<'py> IntoPyObject<'py> for &'_ u8 {
269222 u8:: into_pyobject ( * self , py)
270223 }
271224
272- #[ cfg( feature = "experimental-inspect" ) ]
273- fn type_output ( ) -> TypeInfo {
274- TypeInfo :: builtin ( "int" )
275- }
276-
277225 #[ inline]
278226 fn borrowed_sequence_into_pyobject < I > (
279227 iter : I ,
@@ -302,11 +250,6 @@ impl<'py> FromPyObject<'_, 'py> for u8 {
302250 u8:: try_from ( val) . map_err ( |e| exceptions:: PyOverflowError :: new_err ( e. to_string ( ) ) )
303251 }
304252
305- #[ cfg( feature = "experimental-inspect" ) ]
306- fn type_input ( ) -> TypeInfo {
307- Self :: type_output ( )
308- }
309-
310253 #[ inline]
311254 fn sequence_extractor (
312255 obj : Borrowed < ' _ , ' py , PyAny > ,
@@ -437,11 +380,6 @@ mod fast_128bit_int_conversion {
437380 Ok ( int_from_le_bytes:: <{ $is_signed } >( py, & bytes) )
438381 }
439382 }
440-
441- #[ cfg( feature = "experimental-inspect" ) ]
442- fn type_output( ) -> TypeInfo {
443- TypeInfo :: builtin( "int" )
444- }
445383 }
446384
447385 impl <' py> IntoPyObject <' py> for & $rust_type {
@@ -456,11 +394,6 @@ mod fast_128bit_int_conversion {
456394 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
457395 ( * self ) . into_pyobject( py)
458396 }
459-
460- #[ cfg( feature = "experimental-inspect" ) ]
461- fn type_output( ) -> TypeInfo {
462- TypeInfo :: builtin( "int" )
463- }
464397 }
465398
466399 impl FromPyObject <' _, ' _> for $rust_type {
@@ -513,11 +446,6 @@ mod fast_128bit_int_conversion {
513446 Ok ( <$rust_type>:: from_ne_bytes( buffer) )
514447 }
515448 }
516-
517- #[ cfg( feature = "experimental-inspect" ) ]
518- fn type_input( ) -> TypeInfo {
519- Self :: type_output( )
520- }
521449 }
522450 } ;
523451 }
@@ -591,11 +519,6 @@ mod slow_128bit_int_conversion {
591519 . cast_into_unchecked( ) )
592520 }
593521 }
594-
595- #[ cfg( feature = "experimental-inspect" ) ]
596- fn type_output( ) -> TypeInfo {
597- TypeInfo :: builtin( "int" )
598- }
599522 }
600523
601524 impl <' py> IntoPyObject <' py> for & $rust_type {
@@ -610,11 +533,6 @@ mod slow_128bit_int_conversion {
610533 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
611534 ( * self ) . into_pyobject( py)
612535 }
613-
614- #[ cfg( feature = "experimental-inspect" ) ]
615- fn type_output( ) -> TypeInfo {
616- TypeInfo :: builtin( "int" )
617- }
618536 }
619537
620538 impl FromPyObject <' _, ' _> for $rust_type {
@@ -640,11 +558,6 @@ mod slow_128bit_int_conversion {
640558 Ok ( ( <$rust_type>:: from( upper) << SHIFT ) | lower)
641559 }
642560 }
643-
644- #[ cfg( feature = "experimental-inspect" ) ]
645- fn type_input( ) -> TypeInfo {
646- Self :: type_output( )
647- }
648561 }
649562 } ;
650563 }
@@ -681,11 +594,6 @@ macro_rules! nonzero_int_impl {
681594 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
682595 self . get( ) . into_pyobject( py)
683596 }
684-
685- #[ cfg( feature = "experimental-inspect" ) ]
686- fn type_output( ) -> TypeInfo {
687- TypeInfo :: builtin( "int" )
688- }
689597 }
690598
691599 impl <' py> IntoPyObject <' py> for & $nonzero_type {
@@ -700,11 +608,6 @@ macro_rules! nonzero_int_impl {
700608 fn into_pyobject( self , py: Python <' py>) -> Result <Self :: Output , Self :: Error > {
701609 ( * self ) . into_pyobject( py)
702610 }
703-
704- #[ cfg( feature = "experimental-inspect" ) ]
705- fn type_output( ) -> TypeInfo {
706- TypeInfo :: builtin( "int" )
707- }
708611 }
709612
710613 impl FromPyObject <' _, ' _> for $nonzero_type {
@@ -718,11 +621,6 @@ macro_rules! nonzero_int_impl {
718621 <$nonzero_type>:: try_from( val)
719622 . map_err( |_| exceptions:: PyValueError :: new_err( "invalid zero value" ) )
720623 }
721-
722- #[ cfg( feature = "experimental-inspect" ) ]
723- fn type_input( ) -> TypeInfo {
724- <$primitive_type>:: type_input( )
725- }
726624 }
727625 } ;
728626}
0 commit comments