File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ pub(crate) mod decl {
343
343
infer_variance : bool ,
344
344
}
345
345
346
- #[ pyclass( flags( HAS_DICT ) , with( AsNumber , Constructor ) ) ]
346
+ #[ pyclass( flags( HAS_DICT ) , with( AsNumber , Constructor , Representable ) ) ]
347
347
impl ParamSpec {
348
348
#[ pymethod]
349
349
fn __mro_entries__ ( & self , _bases : PyObjectRef , vm : & VirtualMachine ) -> PyResult {
@@ -555,6 +555,14 @@ pub(crate) mod decl {
555
555
}
556
556
}
557
557
558
+ impl Representable for ParamSpec {
559
+ #[ inline( always) ]
560
+ fn repr_str ( zelf : & crate :: Py < Self > , vm : & VirtualMachine ) -> PyResult < String > {
561
+ let name = zelf. __name__ ( ) . str ( vm) ?;
562
+ Ok ( format ! ( "~{}" , name) )
563
+ }
564
+ }
565
+
558
566
pub ( crate ) fn make_paramspec ( name : PyObjectRef ) -> ParamSpec {
559
567
ParamSpec {
560
568
name,
You can’t perform that action at this time.
0 commit comments