Commit 8f72f453 authored by di68kap's avatar di68kap

- DHParser: transform: issubtype bugfix für cython

parent a3db829f
......@@ -218,6 +218,8 @@ def issubtype(sub_type, base_type):
try:
ot = t.__origin__
except AttributeError:
if t == 'unicode': # work-around for cython bug
return str
return t
return ot if ot is not None else t
return issubclass(origin(sub_type), origin(base_type))
......
......@@ -40,7 +40,7 @@ cpdef _reduce_child(node: Node, child: Node)
cpdef replace_by_single_child(context: List[Node])
cpdef reduce_single_child(context: List[Node])
# cpdef replace_or_reduce(context: List[Node], condition: Callable = ?)
# cpdef replace_parser(context: List[Node], name: str)
# cpdef change_tag_name(context: List[Node], name: str)
# cpdef flatten(context: List[Node], condition: Callable = ?,
# recursive: bool = ?)
cpdef collapse(context: List[Node])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment