Skip to content

Tag: python-3.8

Different runtime behavior for non-generic typing

Consider these two scenarios: and Running the former (expectedly) throws a TypeError: However the latter doesn’t, and proceeds to the print statement without issue: I would expect a TypeError in both cases. Why is there no TypeError when the Queue[int] type is inside of a class’s __init__ method? …

unable to use OAEP decryption in python

Here’s my code: Here’s the error I get: What am I doing wrong? I’m running Python 3.8.3. Answer The mgfunc parameter (3rd parameter) for the mask generation function is incorrectly specified in the posted code. According to the description of Crypto.Cipher.PKCS1_OAEP.new(): mgfunc (callable)…