@@ -103,12 +103,12 @@ impl FnType {
103
103
}
104
104
FnType :: FnClass => {
105
105
quote ! {
106
- let _slf = pyo3:: types:: PyType :: from_type_ptr( _py, _slf as * mut pyo3:: ffi:: PyTypeObject ) ;
106
+ let _slf = :: pyo3:: types:: PyType :: from_type_ptr( _py, _slf as * mut :: pyo3:: ffi:: PyTypeObject ) ;
107
107
}
108
108
}
109
109
FnType :: FnModule => {
110
110
quote ! {
111
- let _slf = _py. from_borrowed_ptr:: <pyo3:: types:: PyModule >( _slf) ;
111
+ let _slf = _py. from_borrowed_ptr:: <:: pyo3:: types:: PyModule >( _slf) ;
112
112
}
113
113
}
114
114
}
@@ -455,17 +455,17 @@ impl<'a> FnSpec<'a> {
455
455
quote ! ( #func_name)
456
456
} ;
457
457
let rust_call =
458
- quote ! { pyo3:: callback:: convert( #py, #rust_name( #self_arg #( #arg_names) , * ) ) } ;
458
+ quote ! { :: pyo3:: callback:: convert( #py, #rust_name( #self_arg #( #arg_names) , * ) ) } ;
459
459
Ok ( match self . convention {
460
460
CallingConvention :: Noargs => {
461
461
quote ! {
462
462
unsafe extern "C" fn #ident (
463
- _slf: * mut pyo3:: ffi:: PyObject ,
464
- _args: * mut pyo3:: ffi:: PyObject ,
465
- ) -> * mut pyo3:: ffi:: PyObject
463
+ _slf: * mut :: pyo3:: ffi:: PyObject ,
464
+ _args: * mut :: pyo3:: ffi:: PyObject ,
465
+ ) -> * mut :: pyo3:: ffi:: PyObject
466
466
{
467
467
#deprecations
468
- pyo3:: callback:: handle_panic( |#py| {
468
+ :: pyo3:: callback:: handle_panic( |#py| {
469
469
#self_conversion
470
470
#rust_call
471
471
} )
@@ -476,23 +476,24 @@ impl<'a> FnSpec<'a> {
476
476
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, true ) ?;
477
477
quote ! {
478
478
unsafe extern "C" fn #ident (
479
- _slf: * mut pyo3:: ffi:: PyObject ,
480
- _args: * const * mut pyo3:: ffi:: PyObject ,
481
- _nargs: pyo3:: ffi:: Py_ssize_t ,
482
- _kwnames: * mut pyo3:: ffi:: PyObject ) -> * mut pyo3:: ffi:: PyObject
479
+ _slf: * mut :: pyo3:: ffi:: PyObject ,
480
+ _args: * const * mut :: pyo3:: ffi:: PyObject ,
481
+ _nargs: :: pyo3:: ffi:: Py_ssize_t ,
482
+ _kwnames: * mut :: pyo3:: ffi:: PyObject ) -> * mut :: pyo3:: ffi:: PyObject
483
483
{
484
484
#deprecations
485
- pyo3:: callback:: handle_panic( |#py| {
485
+ :: pyo3:: callback:: handle_panic( |#py| {
486
486
#self_conversion
487
- let _kwnames: Option <& pyo3:: types:: PyTuple > = #py. from_borrowed_ptr_or_opt( _kwnames) ;
487
+ use :: std:: option:: Option ;
488
+ let _kwnames: Option <& :: pyo3:: types:: PyTuple > = #py. from_borrowed_ptr_or_opt( _kwnames) ;
488
489
// Safety: &PyAny has the same memory layout as `*mut ffi::PyObject`
489
- let _args = _args as * const & pyo3:: PyAny ;
490
- let _kwargs = if let Some ( kwnames) = _kwnames {
491
- std:: slice:: from_raw_parts( _args. offset( _nargs) , kwnames. len( ) )
490
+ let _args = _args as * const & :: pyo3:: PyAny ;
491
+ let _kwargs = if let Option :: Some ( kwnames) = _kwnames {
492
+ :: std:: slice:: from_raw_parts( _args. offset( _nargs) , kwnames. len( ) )
492
493
} else {
493
494
& [ ]
494
495
} ;
495
- let _args = std:: slice:: from_raw_parts( _args, _nargs as usize ) ;
496
+ let _args = :: std:: slice:: from_raw_parts( _args, _nargs as usize ) ;
496
497
497
498
#arg_convert_and_rust_call
498
499
} )
@@ -503,15 +504,15 @@ impl<'a> FnSpec<'a> {
503
504
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, false ) ?;
504
505
quote ! {
505
506
unsafe extern "C" fn #ident (
506
- _slf: * mut pyo3:: ffi:: PyObject ,
507
- _args: * mut pyo3:: ffi:: PyObject ,
508
- _kwargs: * mut pyo3:: ffi:: PyObject ) -> * mut pyo3:: ffi:: PyObject
507
+ _slf: * mut :: pyo3:: ffi:: PyObject ,
508
+ _args: * mut :: pyo3:: ffi:: PyObject ,
509
+ _kwargs: * mut :: pyo3:: ffi:: PyObject ) -> * mut :: pyo3:: ffi:: PyObject
509
510
{
510
511
#deprecations
511
- pyo3:: callback:: handle_panic( |#py| {
512
+ :: pyo3:: callback:: handle_panic( |#py| {
512
513
#self_conversion
513
- let _args = #py. from_borrowed_ptr:: <pyo3:: types:: PyTuple >( _args) ;
514
- let _kwargs: Option <& pyo3:: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
514
+ let _args = #py. from_borrowed_ptr:: <:: pyo3:: types:: PyTuple >( _args) ;
515
+ let _kwargs: :: std :: option :: Option <& :: pyo3:: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
515
516
516
517
#arg_convert_and_rust_call
517
518
} )
@@ -523,20 +524,20 @@ impl<'a> FnSpec<'a> {
523
524
let arg_convert_and_rust_call = impl_arg_params ( self , cls, rust_call, & py, false ) ?;
524
525
quote ! {
525
526
unsafe extern "C" fn #ident (
526
- subtype: * mut pyo3:: ffi:: PyTypeObject ,
527
- _args: * mut pyo3:: ffi:: PyObject ,
528
- _kwargs: * mut pyo3:: ffi:: PyObject ) -> * mut pyo3:: ffi:: PyObject
527
+ subtype: * mut :: pyo3:: ffi:: PyTypeObject ,
528
+ _args: * mut :: pyo3:: ffi:: PyObject ,
529
+ _kwargs: * mut :: pyo3:: ffi:: PyObject ) -> * mut :: pyo3:: ffi:: PyObject
529
530
{
530
531
#deprecations
531
- use pyo3:: callback:: IntoPyCallbackOutput ;
532
- pyo3:: callback:: handle_panic( |#py| {
533
- let _args = #py. from_borrowed_ptr:: <pyo3:: types:: PyTuple >( _args) ;
534
- let _kwargs: Option <& pyo3:: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
532
+ use :: pyo3:: callback:: IntoPyCallbackOutput ;
533
+ :: pyo3:: callback:: handle_panic( |#py| {
534
+ let _args = #py. from_borrowed_ptr:: <:: pyo3:: types:: PyTuple >( _args) ;
535
+ let _kwargs: :: std :: option :: Option <& :: pyo3:: types:: PyDict > = #py. from_borrowed_ptr_or_opt( _kwargs) ;
535
536
536
537
let result = #arg_convert_and_rust_call;
537
- let initializer: pyo3:: PyClassInitializer :: <#cls> = result. convert( #py) ?;
538
+ let initializer: :: pyo3:: PyClassInitializer :: <#cls> = result. convert( #py) ?;
538
539
let cell = initializer. create_cell_from_subtype( #py, subtype) ?;
539
- Ok ( cell as * mut pyo3:: ffi:: PyObject )
540
+ Ok ( cell as * mut :: pyo3:: ffi:: PyObject )
540
541
} )
541
542
}
542
543
}
@@ -551,23 +552,23 @@ impl<'a> FnSpec<'a> {
551
552
let doc = & self . doc ;
552
553
match self . convention {
553
554
CallingConvention :: Noargs => quote ! {
554
- pyo3:: class:: methods:: PyMethodDef :: noargs(
555
+ :: pyo3:: class:: methods:: PyMethodDef :: noargs(
555
556
#python_name,
556
- pyo3:: class:: methods:: PyCFunction ( #wrapper) ,
557
+ :: pyo3:: class:: methods:: PyCFunction ( #wrapper) ,
557
558
#doc,
558
559
)
559
560
} ,
560
561
CallingConvention :: Fastcall => quote ! {
561
- pyo3:: class:: methods:: PyMethodDef :: fastcall_cfunction_with_keywords(
562
+ :: pyo3:: class:: methods:: PyMethodDef :: fastcall_cfunction_with_keywords(
562
563
#python_name,
563
- pyo3:: class:: methods:: PyCFunctionFastWithKeywords ( #wrapper) ,
564
+ :: pyo3:: class:: methods:: PyCFunctionFastWithKeywords ( #wrapper) ,
564
565
#doc,
565
566
)
566
567
} ,
567
568
CallingConvention :: Varargs => quote ! {
568
- pyo3:: class:: methods:: PyMethodDef :: cfunction_with_keywords(
569
+ :: pyo3:: class:: methods:: PyMethodDef :: cfunction_with_keywords(
569
570
#python_name,
570
- pyo3:: class:: methods:: PyCFunctionWithKeywords ( #wrapper) ,
571
+ :: pyo3:: class:: methods:: PyCFunctionWithKeywords ( #wrapper) ,
571
572
#doc,
572
573
)
573
574
} ,
0 commit comments