Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Union[A,B] type hint yields [user class A, user class B] instead of [instance A, instance B] #459

@lostmsu

Description

@lostmsu

Subj.

from typing import Union
class A:
  pass
class B:
  pass
def a() -> Union[A,B]: ...
def b() -> A: ...

Analysis of a's return type gives back a set of user class A and user class B, whereas it should be instance A and instance B.
For comparison, analysis of b's return type gives back a set of instance A.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions