Skip to content

Commit

Permalink
chore: [bump minor]
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Nov 17, 2023
1 parent f1e30d5 commit cee6c90
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dol/trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -3028,18 +3028,16 @@ def compose_with(self, other):
encoder=Pipe(self.encoder, other.encoder),
decoder=Pipe(other.decoder, self.decoder),
)

def invert(self):
"""Return a codec that is the inverse of this one.
That is, encoder and decoder will be swapped."""
cls = type(self)
return cls(encoder=self.decoder, decoder=self.encoder)

# operators
__add__ = compose_with
__invert__ = invert




class ValueCodec(Generic[DecodedType, EncodedType], Codec[DecodedType, EncodedType]):
Expand Down

0 comments on commit cee6c90

Please sign in to comment.