This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ofekmeister
Recipients Ofekmeister
Date 2021-01-19.08:11:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611043886.41.0.0460380648291.issue42965@roundup.psfhosted.org>
In-reply-to
Content
https://docs.python.org/3.9/library/typing.html#callable

```
Python 3.9.1 (default, Jan 12 2021, 16:45:25)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Optional
>>> from collections.abc import Callable
>>>
>>> Hasher = Optional[Callable[[bytes], bytes]]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/typing.py", line 262, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.9/typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "/usr/local/lib/python3.9/typing.py", line 463, in Optional
    return Union[arg, type(None)]
  File "/usr/local/lib/python3.9/typing.py", line 262, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.9/typing.py", line 339, in __getitem__
    return self._getitem(self, parameters)
  File "/usr/local/lib/python3.9/typing.py", line 451, in Union
    parameters = _remove_dups_flatten(parameters)
  File "/usr/local/lib/python3.9/typing.py", line 231, in _remove_dups_flatten
    return tuple(_deduplicate(params))
  File "/usr/local/lib/python3.9/typing.py", line 205, in _deduplicate
    all_params = set(params)
TypeError: unhashable type: 'list'
>>>
>>> from typing import Tuple
>>> Hasher = Optional[Callable[Tuple[bytes], bytes]]
>>>
```

Tuple type for arguments makes it work
History
Date User Action Args
2021-01-19 08:11:26Ofekmeistersetrecipients: + Ofekmeister
2021-01-19 08:11:26Ofekmeistersetmessageid: <1611043886.41.0.0460380648291.issue42965@roundup.psfhosted.org>
2021-01-19 08:11:26Ofekmeisterlinkissue42965 messages
2021-01-19 08:11:25Ofekmeistercreate