瀏覽代碼

type stubs: Allows `v_args` to decorate a class.

v_args is described as taking a callbable as argument: 36a7b050c1/lark-stubs/visitors.pyi (L75-L79)
Yet the documentation states it can decorate a class: 5b30ba4841/lark/visitors.py (L417-L418)
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2
Brice Arnould 3 年之前
父節點
當前提交
b59764f898
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      lark-stubs/visitors.pyi

+ 3
- 3
lark-stubs/visitors.pyi 查看文件

@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-

from typing import TypeVar, Tuple, List, Callable, Generic, Type
from typing import TypeVar, Tuple, List, Callable, Generic, Type, Union
from abc import ABC
from .tree import Tree

_T = TypeVar('_T')
_R = TypeVar('_R')
_FUNC = Callable[..., _T]
_DECORED = Union[_FUNC, type]

class Transformer(ABC, Generic[_T]):

@@ -76,7 +76,7 @@ def v_args(
inline: bool = False,
meta: bool = False,
tree: bool = False
) -> Callable[[_FUNC], _FUNC]:
) -> Callable[[_DECORED], _DECORED]:
...




Loading…
取消
儲存