Unexpected keyword argument 'hash_func' in constructor call
27 verifier = public_key.verifier(
28 signature,
29 padding=ec.ECDSA(max_size=32).padding,
30 algorithm=ec.ECDSA(hash_func=hashlib.sha256),31 )
32 try:
33 verifier.verify(message.encode())
Unexpected keyword argument 'max_size' in constructor call
26 def verify(self, public_key, message, signature):
27 verifier = public_key.verifier(
28 signature,
29 padding=ec.ECDSA(max_size=32).padding,30 algorithm=ec.ECDSA(hash_func=hashlib.sha256),
31 )
32 try:
Unexpected keyword argument 'hash_func' in constructor call
18 def sign(self, private_key, message):
19 signer = private_key.signer(
20 padding=ec.ECDSA(max_size=32).padding,
21 algorithm=ec.ECDSA(hash_func=hashlib.sha256),22 )
23 signature = signer.sign(message.encode())
24 return signature
Unexpected keyword argument 'max_size' in constructor call
17
18 def sign(self, private_key, message):
19 signer = private_key.signer(
20 padding=ec.ECDSA(max_size=32).padding,21 algorithm=ec.ECDSA(hash_func=hashlib.sha256),
22 )
23 signature = signer.sign(message.encode())
Description
The function call has passed a keyword argument that doesn't correspond to one of the function's parameter names. This is an error.
Bad practice
def update_count(item, available=True)
if available:
count[item] += 1
update_count("coffee", is_available=True) # Wrong keyword arguemnt used
Recommended:
def update_count(item, available=True)
if available:
count[item] += 1
update_count("coffee", available=False)