MCPcopy Create free account
hub / github.com/tox-dev/filelock / __init__

Method __init__

src/filelock/_async_lock/_lock.py:394–417  ·  view source on GitHub ↗
(  # ruff:ignore[too-many-arguments]  # mirrors the AsyncFileLockContext fields set at construction
        self,
        *,
        lock_file: str,
        timeout: float,
        mode: int,
        blocking: bool,
        poll_interval: float,
        lifetime: float | None = None,
        run_in_executor: bool = True,
        executor: futures.Executor | None = None,
        loop: asyncio.AbstractEventLoop | None = None,
    )

Source from the content-addressed store, hash-verified

392
393 # threading.local runs __init__ again with these arguments the first time each thread touches the context.
394 def __init__( # ruff:ignore[too-many-arguments] # mirrors the AsyncFileLockContext fields set at construction
395 self,
396 *,
397 lock_file: str,
398 timeout: float,
399 mode: int,
400 blocking: bool,
401 poll_interval: float,
402 lifetime: float | None = None,
403 run_in_executor: bool = True,
404 executor: futures.Executor | None = None,
405 loop: asyncio.AbstractEventLoop | None = None,
406 ) -> None:
407 self.current = AsyncFileLockContext(
408 lock_file=lock_file,
409 timeout=timeout,
410 mode=mode,
411 blocking=blocking,
412 poll_interval=poll_interval,
413 lifetime=lifetime,
414 run_in_executor=run_in_executor,
415 executor=executor,
416 loop=loop,
417 )
418
419
420# Dataclass annotation lookup during class creation needs the defining module on Python 3.11.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected