mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
fix: typing module enums references
Enum names exist only during type checking. During runtime they should be denoted as named integral types
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from .node import ASTNode
|
||||
from .node import ASTNode, ASTNodeType
|
||||
from .namespace_node import NamespaceNode
|
||||
from .class_node import ClassNode, ClassProperty
|
||||
from .function_node import FunctionNode
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import abc
|
||||
import enum
|
||||
import itertools
|
||||
from typing import (Iterator, Type, TypeVar, Iterable, Dict,
|
||||
from typing import (Iterator, Type, TypeVar, Dict,
|
||||
Optional, Tuple, DefaultDict)
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
@@ -417,6 +417,10 @@ class ASTNodeTypeNode(TypeNode):
|
||||
self._module_name = module_name
|
||||
self._ast_node: Optional[weakref.ProxyType[ASTNode]] = None
|
||||
|
||||
@property
|
||||
def ast_node(self):
|
||||
return self._ast_node
|
||||
|
||||
@property
|
||||
def typename(self) -> str:
|
||||
if self._ast_node is None:
|
||||
|
||||
Reference in New Issue
Block a user