|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing some enums for function type annotations. |
|
8 """ |
|
9 |
|
10 # |
|
11 # adapted from flake8-annotations v2.6.2 |
|
12 # |
|
13 |
|
14 from enum import Enum, auto |
|
15 |
|
16 |
|
17 class FunctionType(Enum): |
|
18 """ |
|
19 Class representing the various function types. |
|
20 """ |
|
21 PUBLIC = auto() |
|
22 PROTECTED = auto() # Leading single underscore |
|
23 PRIVATE = auto() # Leading double underscore |
|
24 SPECIAL = auto() # Leading & trailing double underscore |
|
25 |
|
26 |
|
27 class ClassDecoratorType(Enum): |
|
28 """ |
|
29 Class representing the various class method decorators. |
|
30 """ |
|
31 CLASSMETHOD = auto() |
|
32 STATICMETHOD = auto() |
|
33 |
|
34 |
|
35 class AnnotationType(Enum): |
|
36 """ |
|
37 Class representing the kind of missing type annotation. |
|
38 """ |
|
39 POSONLYARGS = auto() |
|
40 ARGS = auto() |
|
41 VARARG = auto() |
|
42 KWONLYARGS = auto() |
|
43 KWARG = auto() |
|
44 RETURN = auto() |