Explorar el Código

Changed sequence to collection

gm/2021-09-23T00Z/github.com--lark-parser-lark/1.0b
Erez Sh hace 3 años
padre
commit
a8900c13b7
Se han modificado 2 ficheros con 3 adiciones y 4 borrados
  1. +2
    -3
      lark/exceptions.py
  2. +1
    -1
      lark/utils.py

+ 2
- 3
lark/exceptions.py Ver fichero

@@ -1,6 +1,5 @@
from .utils import logger, NO_VALUE
from typing import Dict, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, TYPE_CHECKING
from collections.abc import Sequence
from typing import Dict, Iterable, Callable, Union, TypeVar, Tuple, Any, List, Set, Optional, Collection, TYPE_CHECKING

if TYPE_CHECKING:
from .lexer import Token
@@ -17,7 +16,7 @@ class ConfigurationError(LarkError, ValueError):
pass


def assert_config(value, options: Sequence, msg='Got %r, expected one of %s'):
def assert_config(value, options: Collection, msg='Got %r, expected one of %s'):
if value not in options:
raise ConfigurationError(msg % (value, options))



+ 1
- 1
lark/utils.py Ver fichero

@@ -241,7 +241,7 @@ def combine_alternatives(lists):
try:
import atomicwrites
except ImportError:
atomicwrites = None
atomicwrites = None # type: ignore

class FS:
exists = os.path.exists


Cargando…
Cancelar
Guardar