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.

classification
Title: Making a Tuple or Dict with Callable[ ..., xxx ] gives error
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Pauli Salmenrinne
Priority: normal Keywords:

Created on 2017-02-22 08:14 by Pauli Salmenrinne, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg288343 - (view) Author: Pauli Salmenrinne (Pauli Salmenrinne) Date: 2017-02-22 08:14
Hi all. 

I tried asking this on IRC channel, but ended up with no answear. Simple example:

from typing import Dict, Callable
CmdFun    = Callable[ ... , int ]
CmdFull   = Dict[ str, CmdFun ]

Gives error:
pauli@HPauli-U1604 ~ % python3 /tmp/silly.py
Traceback (most recent call last):
  File "/tmp/silly.py", line 5, in <module>
    CmdFull   = Dict[ str, CmdFun ]
  File "/usr/lib/python3.5/typing.py", line 1025, in __getitem__
    tvars = _type_vars(params)
  File "/usr/lib/python3.5/typing.py", line 284, in _type_vars
    _get_type_vars(types, tvars)
  File "/usr/lib/python3.5/typing.py", line 279, in _get_type_vars
    t._get_type_vars(tvars)
  File "/usr/lib/python3.5/typing.py", line 786, in _get_type_vars
    _get_type_vars(self.__args__, tvars)
  File "/usr/lib/python3.5/typing.py", line 277, in _get_type_vars
    for t in types:
TypeError: 'ellipsis' object is not iterable


The python intrepretter is the one shipped with ubuntu16.04 currently: Python 3.5.2

Based on the documentation i think this should be valid statement. The similar issue raises if the Dict is replaced with Tuple, but i did not try any other combinations.
msg288345 - (view) Author: Pauli Salmenrinne (Pauli Salmenrinne) Date: 2017-02-22 08:51
I tried to reproduce the issue with 3.5 branch from the current github, and the issue seems to be fixed.

Closing this as fixed, sorry for the trouble.
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73804
2017-02-22 08:51:45Pauli Salmenrinnesetstatus: open -> closed
resolution: fixed
messages: + msg288345

stage: resolved
2017-02-22 08:14:04Pauli Salmenrinnecreate