-
-
Notifications
You must be signed in to change notification settings - Fork 639
Open
Description
Students often call these functions with strings. This results in an error like "str has no attribute parent":
336 """
337 dom = self.domain() # = plaintext_space = ciphertext_space
--> 338 if not isinstance(M, StringMonoidElement) and M.parent() == dom:
339 raise TypeError("Argument M (= %s) must be a string in the plaintext/ciphertext space." % M)
340 from sage.rings.finite_rings.integer_mod import Mod
AttributeError: 'str' object has no attribute 'parent'
Note that it almost made it to raising a TypeError
which would be tidier.
Component: cryptography
Branch: u/hoodmane/classical-ciper-typeerrors
Issue created by migration from https://trac.sagemath.org/ticket/33658