1616
1717"""Base classes and helpers."""
1818
19- from __future__ import annotations
19+ from __future__ import annotations as _
2020
21- import abc
21+ import abc as _abc
2222
2323from . import _typing as _t
2424
25+ # ignore TCH001 to make sphinx not completely drop the ball
26+ from ._addressing import Address as _Address # noqa: TCH001
27+
2528
2629if _t .TYPE_CHECKING :
27- from ._addressing import Address
2830 from ._typing import Protocol as _Protocol
2931else :
3032 _Protocol = object
@@ -279,13 +281,13 @@ def from_raw_values(cls, values: _t.Iterable[str]) -> Bookmarks:
279281class ServerInfo :
280282 """Represents a package of information relating to a Neo4j server."""
281283
282- def __init__ (self , address : Address , protocol_version : tuple [int , int ]):
284+ def __init__ (self , address : _Address , protocol_version : tuple [int , int ]):
283285 self ._address = address
284286 self ._protocol_version = protocol_version
285287 self ._metadata : dict = {}
286288
287289 @property
288- def address (self ) -> Address :
290+ def address (self ) -> _Address :
289291 """Network address of the remote server."""
290292 return self ._address
291293
@@ -314,7 +316,7 @@ def update(self, metadata: dict) -> None:
314316 self ._metadata .update (metadata )
315317
316318
317- class BookmarkManager (_Protocol , metaclass = abc .ABCMeta ):
319+ class BookmarkManager (_Protocol , metaclass = _abc .ABCMeta ):
318320 """
319321 Class to manage bookmarks throughout the driver's lifetime.
320322
@@ -355,7 +357,7 @@ class BookmarkManager(_Protocol, metaclass=abc.ABCMeta):
355357 .. versionchanged:: 5.8 Stabilized from experimental.
356358 """
357359
358- @abc .abstractmethod
360+ @_abc .abstractmethod
359361 def update_bookmarks (
360362 self ,
361363 previous_bookmarks : _t .Collection [str ],
@@ -371,7 +373,7 @@ def update_bookmarks(
371373 """
372374 ...
373375
374- @abc .abstractmethod
376+ @_abc .abstractmethod
375377 def get_bookmarks (self ) -> _t .Collection [str ]:
376378 """
377379 Return the bookmarks stored in the bookmark manager.
@@ -381,7 +383,7 @@ def get_bookmarks(self) -> _t.Collection[str]:
381383 ...
382384
383385
384- class AsyncBookmarkManager (_Protocol , metaclass = abc .ABCMeta ):
386+ class AsyncBookmarkManager (_Protocol , metaclass = _abc .ABCMeta ):
385387 """
386388 Same as :class:`.BookmarkManager` but with async methods.
387389
@@ -396,7 +398,7 @@ class AsyncBookmarkManager(_Protocol, metaclass=abc.ABCMeta):
396398 .. versionchanged:: 5.8 Stabilized from experimental.
397399 """
398400
399- @abc .abstractmethod
401+ @_abc .abstractmethod
400402 async def update_bookmarks (
401403 self ,
402404 previous_bookmarks : _t .Collection [str ],
@@ -405,7 +407,7 @@ async def update_bookmarks(
405407
406408 update_bookmarks .__doc__ = BookmarkManager .update_bookmarks .__doc__
407409
408- @abc .abstractmethod
410+ @_abc .abstractmethod
409411 async def get_bookmarks (self ) -> _t .Collection [str ]: ...
410412
411413 get_bookmarks .__doc__ = BookmarkManager .get_bookmarks .__doc__
0 commit comments