Browse Source

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 years ago
parent
commit
b59764f898
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lark-stubs/visitors.pyi

+ 3
- 3
lark-stubs/visitors.pyi View File

@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*- # -*- 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 abc import ABC
from .tree import Tree from .tree import Tree


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


class Transformer(ABC, Generic[_T]): class Transformer(ABC, Generic[_T]):


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






Loading…
Cancel
Save