| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from inspect import Parameter, Signature |
| 4 |
from typing import List, Union # NoQA: UP035 |
| 5 |
|
| 6 |
|
| 7 |
class Foo: |
| 8 |
pass |
| 9 |
|
| 10 |
|
| 11 |
class Bar: |
| 12 |
def __init__(self, x, y): |
| 13 |
pass |
| 14 |
|
| 15 |
|
| 16 |
class Baz: |
| 17 |
def __new__(cls, x, y): |
| 18 |
pass |
| 19 |
|
| 20 |
|
| 21 |
class Qux: |
| 22 |
__signature__ = Signature( |
| 23 |
parameters=[ |
| 24 |
Parameter('foo', Parameter.POSITIONAL_OR_KEYWORD), |
| 25 |
Parameter('bar', Parameter.POSITIONAL_OR_KEYWORD), |
| 26 |
] |
| 27 |
) |
| 28 |
|
| 29 |
def __init__(self, x, y): |
| 30 |
pass |
| 31 |
|
| 32 |
|
| 33 |
class Quux(List[Union[int, float]]): # NoQA: UP006,UP007 |
| 34 |
"""A subclass of List[Union[int, float]]""" |
| 35 |
|
| 36 |
pass |
| 37 |
|
| 38 |
|
| 39 |
class Corge(Quux): |
| 40 |
pass |
| 41 |
|
| 42 |
|
| 43 |
Alias = Foo |
| 44 |
|
| 45 |
#: docstring |
| 46 |
OtherAlias = Bar |
| 47 |
|
| 48 |
#: docstring |
| 49 |
IntAlias = int |