@@ -151,11 +151,11 @@ macro_rules! pyobject_native_static_type_object(
151151#[ doc( hidden) ]
152152#[ macro_export]
153153macro_rules! pyobject_native_type_info(
154- ( $name: ty, $typeobject: expr, $module : expr, $python_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
154+ ( $name: ty, $typeobject: expr, $type_hint_module : expr, $type_hint_name : expr , $module : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
155155 // SAFETY: macro caller has upheld the safety contracts
156156 unsafe impl <$( $generics, ) * > $crate:: type_object:: PyTypeInfo for $name {
157157 const NAME : & ' static str = stringify!( $name) ;
158- const MODULE : :: std:: option:: Option <& ' static str > = :: std :: option :: Option :: Some ( $module) ;
158+ const MODULE : :: std:: option:: Option <& ' static str > = $module;
159159
160160 #[ inline]
161161 #[ allow( clippy:: redundant_closure_call) ]
@@ -188,12 +188,12 @@ macro_rules! pyobject_native_type_info(
188188#[ doc( hidden) ]
189189#[ macro_export]
190190macro_rules! pyobject_native_type_info(
191- ( $name: ty, $typeobject: expr, $module : expr, $python_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
191+ ( $name: ty, $typeobject: expr, $type_hint_module : expr, $type_hint_name : expr , $module : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
192192 // SAFETY: macro caller has upheld the safety contracts
193193 unsafe impl <$( $generics, ) * > $crate:: type_object:: PyTypeInfo for $name {
194194 const NAME : & ' static str = stringify!( $name) ;
195- const MODULE : :: std:: option:: Option <& ' static str > = :: std :: option :: Option :: Some ( $module) ;
196- const TYPE_HINT : $crate:: inspect:: TypeHint = $crate:: inspect:: TypeHint :: module_attr( $module , $python_name ) ;
195+ const MODULE : :: std:: option:: Option <& ' static str > = $module;
196+ const TYPE_HINT : $crate:: inspect:: TypeHint = $crate:: inspect:: TypeHint :: module_attr( $type_hint_module , $type_hint_name ) ;
197197
198198 #[ inline]
199199 #[ allow( clippy:: redundant_closure_call) ]
@@ -226,12 +226,12 @@ macro_rules! pyobject_native_type_info(
226226#[ doc( hidden) ]
227227#[ macro_export]
228228macro_rules! pyobject_native_type_core {
229- ( $name: ty, $typeobject: expr, $module : expr, $python_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
229+ ( $name: ty, $typeobject: expr, $type_hint_module : expr, $type_hint_name : expr , #module=$module : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
230230 $crate:: pyobject_native_type_named!( $name $( ; $generics) * ) ;
231- $crate:: pyobject_native_type_info!( $name, $typeobject, $module , $python_name $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
231+ $crate:: pyobject_native_type_info!( $name, $typeobject, $type_hint_module , $type_hint_name , $module $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
232232 } ;
233- ( $name: ty, $typeobject: expr, $python_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
234- $crate:: pyobject_native_type_core!( $name, $typeobject, "builtins" , $python_name $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
233+ ( $name: ty, $typeobject: expr, $type_hint_module : expr , $type_hint_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
234+ $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module , $type_hint_name , #module= :: std :: option :: Option :: Some ( "builtins" ) $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
235235 } ;
236236}
237237
@@ -263,8 +263,8 @@ macro_rules! pyobject_native_type_sized {
263263#[ doc( hidden) ]
264264#[ macro_export]
265265macro_rules! pyobject_native_type {
266- ( $name: ty, $layout: path, $typeobject: expr, $module : expr, $python_name : expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
267- $crate:: pyobject_native_type_core!( $name, $typeobject, $module , $python_name $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
266+ ( $name: ty, $layout: path, $typeobject: expr, $type_hint_module : expr, $type_hint_name : expr $ ( , #module=$module : expr ) ? $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
267+ $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module , $type_hint_name $ ( , #module=$module ) ? $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
268268 // To prevent inheriting native types with ABI3
269269 #[ cfg( not( Py_LIMITED_API ) ) ]
270270 $crate:: pyobject_native_type_sized!( $name, $layout $( ; $generics) * ) ;
0 commit comments