File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use crate::obj::objbool;
21
21
use crate :: obj:: objbuiltinfunc:: PyBuiltinFunction ;
22
22
use crate :: obj:: objbytearray;
23
23
use crate :: obj:: objbytes;
24
- use crate :: obj:: objclassmethod;
24
+ use crate :: obj:: objclassmethod:: { self , PyClassMethod } ;
25
25
use crate :: obj:: objcode;
26
26
use crate :: obj:: objcode:: PyCodeRef ;
27
27
use crate :: obj:: objcomplex:: { self , PyComplex } ;
@@ -668,6 +668,19 @@ impl PyContext {
668
668
)
669
669
}
670
670
671
+ pub fn new_classmethod < F , T , R > ( & self , f : F ) -> PyObjectRef
672
+ where
673
+ F : IntoPyNativeFunc < T , R > ,
674
+ {
675
+ PyObject :: new (
676
+ PyClassMethod {
677
+ callable : self . new_rustfunc ( f) ,
678
+ } ,
679
+ self . classmethod_type ( ) ,
680
+ None ,
681
+ )
682
+ }
683
+
671
684
pub fn new_property < F , I , V > ( & self , f : F ) -> PyObjectRef
672
685
where
673
686
F : IntoPyNativeFunc < I , V > ,
You can’t perform that action at this time.
0 commit comments