Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/blinker/__init__.py: 62%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from __future__ import annotations
3import typing as t
5from .base import ANY
6from .base import default_namespace
7from .base import NamedSignal
8from .base import Namespace
9from .base import Signal
10from .base import signal
12__all__ = [
13 "ANY",
14 "default_namespace",
15 "NamedSignal",
16 "Namespace",
17 "Signal",
18 "signal",
19]
22def __getattr__(name: str) -> t.Any:
23 import warnings
25 if name == "__version__":
26 import importlib.metadata
28 warnings.warn(
29 "The '__version__' attribute is deprecated and will be removed in"
30 " Blinker 1.9.0. Use feature detection or"
31 " 'importlib.metadata.version(\"blinker\")' instead.",
32 DeprecationWarning,
33 stacklevel=2,
34 )
35 return importlib.metadata.version("blinker")
37 if name == "receiver_connected":
38 from .base import _receiver_connected
40 warnings.warn(
41 "The global 'receiver_connected' signal is deprecated and will be"
42 " removed in Blinker 1.9. Use 'Signal.receiver_connected' and"
43 " 'Signal.receiver_disconnected' instead.",
44 DeprecationWarning,
45 stacklevel=2,
46 )
47 return _receiver_connected
49 if name == "WeakNamespace":
50 from .base import _WeakNamespace
52 warnings.warn(
53 "'WeakNamespace' is deprecated and will be removed in Blinker 1.9."
54 " Use 'Namespace' instead.",
55 DeprecationWarning,
56 stacklevel=2,
57 )
58 return _WeakNamespace
60 raise AttributeError(name)