← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1704473] Re: Traceback when using typing.Optional[Type] on xenial

 

** Changed in: python3.5 (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1704473

Title:
  Traceback when using typing.Optional[Type] on xenial

Status in python3.5 package in Ubuntu:
  Invalid
Status in python3.5 source package in Xenial:
  New
Status in python3.5 source package in Yakkety:
  Won't Fix

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://github.com/python/typing/issues/266.)

  (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[Type[BaseException]]"
  ```

  Expected Behaviour
  ==================

  No output, exits 0.

  Actual Behaviour
  ================

  ```
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/lib/python3.5/typing.py", line 649, in __getitem__
      return Union[arg, type(None)]
    File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
      dict(self.__dict__), parameters, _root=True)
    File "/usr/lib/python3.5/typing.py", line 512, in __new__
      for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
    File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
      for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
    File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
      if super().__subclasscheck__(cls):
    File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
      for scls in cls.__subclasses__():
  TypeError: descriptor '__subclasses__' of 'type' object needs an argument
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.5/+bug/1704473/+subscriptions