How do I specify a type where a tuple could have any values with types I specified?
For example:
def _get_writable_values(self, *, username: str, password: str) -> Tuple[WritableValue]:
h = md5()
h.update(username.encode(DEFAULT_ENCODING) + password.encode(DEFAULT_ENCODING))
concatenated_hash = h.hexdigest()
return (
username,
password,
182, # ???
concatenated_hash,
157, # ???
)
I get this error:
Expected type 'Tuple[Union[str, int, bytes]]', got 'Tuple[str, str, int, str, int]' instead.
WritableValue
is defined like this:
WritableValue = Union[str, int, bytes]
I don't wanna override the type signature for every subclass, what's the correct signature for my use case?