- changed status to resolved
Encoder.unencode should check whether the given word is in the code
I no longer remember if it was exactly this question, or a related question, but I remember distinctly in Lyon that we agreed that better-safe-than-sorry, and that the user should optionally be allowed to disable safety.
In the same spirit, Encoder.unencode
should check that the given word is in the code before unencoding. An optional argument nocheck=False
should allow one to bypass the check for speed.
Programmatically, this is best achieved by having a default implementation in Encoder.unencode
which calls Encoder.unencode_nocheck
when the check has been performed. This is the method that sub-classes usually overload (so they don't need to reimplement the check).
Comments (2)
-
repo owner -
reporter Hmm, the new
Encoder.unencode
doesn't seem to return the message whennocheck==False
?!Btw.: You can also make a test that calling
Encoder.unencode(c,nocheck=True)
doesn't throw an exception whenc
is not a codeword. - Log in to comment
Resolved issue
#58and removed related todo→ <<cset 49e3c2b21ed2>>