File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,9 +100,6 @@ def unwrap(self, default=_MISSING):
100100 case other :
101101 unreachable (other )
102102
103- # experimental
104- __invert__ = unwrap
105-
106103 def expect (self , message_or_exception : str | BaseException , / ) -> T :
107104 match self , message_or_exception :
108105 case Option .Nothing , BaseException () as exception :
@@ -370,9 +367,6 @@ def unwrap(self, default=_MISSING):
370367 case other :
371368 unreachable (other )
372369
373- # experimental
374- __invert__ = unwrap
375-
376370 def as_option (self ) -> Option [R ]:
377371 match self :
378372 case Result .Ok (value ):
@@ -532,9 +526,6 @@ def unwrap(self, default=_MISSING):
532526 case other :
533527 unreachable (other )
534528
535- # experimental
536- __invert__ = unwrap
537-
538529 def as_option (self ) -> Option [R ]:
539530 match self :
540531 case BoundResult .Success (value , _):
Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ def test_option():
160160 option = Option .Some (123 )
161161 assert option ._0 == 123
162162 assert option .unwrap () == 123
163- assert ~ option == 123
164163 assert option .unwrap (456 ) == 123
165164 option = Option .Nothing
166165 assert option is Option .Nothing
@@ -233,7 +232,6 @@ def test_bound_result():
233232 # general features
234233 assert BoundResult .Success (2342 , Exception ) == BoundResult .Success (2342 , Exception )
235234 assert BoundResult .Success (1234 , Exception ).unwrap () == 1234
236- assert ~ BoundResult .Success (1234 , Exception ) == 1234
237235 assert BoundResult .Success (1234 , Exception ).unwrap (34556 ) == 1234
238236 with pytest .raises (ValueError , match = "error" ):
239237 BoundResult .Failed (ValueError ("error" ), ValueError ).unwrap ()
@@ -344,7 +342,6 @@ def test_result():
344342 # general features
345343 assert Result .Ok (2342 ) == Result .Ok (2342 )
346344 assert Result .Ok (1234 ).unwrap () == 1234
347- assert ~ Result .Ok (1234 ) == 1234
348345 assert Result .Ok (1234 ).unwrap (34556 ) == 1234
349346 with pytest .raises (ValueError , match = "error" ):
350347 Result .Err (ValueError ("error" )).unwrap ()
You can’t perform that action at this time.
0 commit comments