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 {
343343 infer_variance : bool ,
344344 }
345345
346- #[ pyclass( flags( HAS_DICT ) , with( AsNumber , Constructor ) ) ]
346+ #[ pyclass( flags( HAS_DICT ) , with( AsNumber , Constructor , Representable ) ) ]
347347 impl ParamSpec {
348348 #[ pymethod]
349349 fn __mro_entries__ ( & self , _bases : PyObjectRef , vm : & VirtualMachine ) -> PyResult {
@@ -555,6 +555,14 @@ pub(crate) mod decl {
555555 }
556556 }
557557
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+
558566 pub ( crate ) fn make_paramspec ( name : PyObjectRef ) -> ParamSpec {
559567 ParamSpec {
560568 name,
You can’t perform that action at this time.
0 commit comments