Traceback when using typing.Optional[Type] on xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3.5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Wishlist
|
Dimitri John Ledkov | ||
Yakkety |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
typing in the Python 3.5.2 stdlib tracebacks when passing Type to a Union (of which Optional is a specific case). (This is typing bug #266: https:/
(This is particularly annoying because as a stdlib library, the fix released by upstream to PyPI can't easily be used even via pip.)
Steps to Reproduce
==================
```
lxc launch ubuntu:x reproducer
lxc exec reproducer -- python3 -c "from typing import Optional, Type; Optional[
```
Expected Behaviour
==================
No output, exits 0.
Actual Behaviour
================
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
return Union[arg, type(None)]
File "/usr/lib/
dict(
File "/usr/lib/
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/
for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
File "/usr/lib/
if super()
File "/usr/lib/
for scls in cls.__subclasse
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
```
Changed in python3.5 (Ubuntu Yakkety): | |
status: | New → Won't Fix |
Changed in python3.5 (Ubuntu): | |
status: | New → Invalid |
tags: | added: id-596922a6adf3fe426db2d169 |
Changed in python3.5 (Ubuntu Xenial): | |
importance: | Undecided → Wishlist |
assignee: | nobody → Dimitri John Ledkov (xnox) |
milestone: | none → xenial-updates |
Yakkety and xenial are the only affected. 3.5.3 has this fix in zesty and artful.