Przeglądaj źródła

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 lat temu
rodzic
commit
b59764f898
1 zmienionych plików z 3 dodań i 3 usunięć
  1. +3
    -3
      lark-stubs/visitors.pyi

+ 3
- 3
lark-stubs/visitors.pyi Wyświetl plik

@@ -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]:
...




Ładowanie…
Anuluj
Zapisz