omlish 0.0.0.dev2__py3-none-any.whl → 0.0.0.dev4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of omlish might be problematic. Click here for more details.

Files changed (124) hide show
  1. omlish/__about__.py +1 -2
  2. omlish/__init__.py +8 -0
  3. omlish/argparse.py +4 -4
  4. omlish/asyncs/__init__.py +23 -2
  5. omlish/asyncs/anyio.py +13 -11
  6. omlish/asyncs/asyncs.py +1 -3
  7. omlish/asyncs/flavors.py +201 -0
  8. omlish/asyncs/futures.py +10 -9
  9. omlish/asyncs/trio_asyncio.py +41 -0
  10. omlish/c3.py +1 -1
  11. omlish/check.py +3 -3
  12. omlish/collections/_abc.py +2 -0
  13. omlish/collections/_io_abc.py +4 -2
  14. omlish/collections/cache/__init__.py +1 -1
  15. omlish/collections/cache/descriptor.py +8 -8
  16. omlish/collections/cache/impl.py +24 -17
  17. omlish/collections/cache/types.py +1 -1
  18. omlish/collections/coerce.py +1 -1
  19. omlish/collections/frozen.py +6 -6
  20. omlish/collections/identity.py +3 -4
  21. omlish/collections/mappings.py +2 -2
  22. omlish/collections/ordered.py +7 -7
  23. omlish/collections/skiplist.py +1 -1
  24. omlish/collections/sorted.py +1 -1
  25. omlish/collections/treap.py +25 -0
  26. omlish/collections/treapmap.py +57 -5
  27. omlish/collections/unmodifiable.py +9 -9
  28. omlish/collections/utils.py +1 -1
  29. omlish/configs/flattening.py +7 -6
  30. omlish/configs/props.py +3 -3
  31. omlish/dataclasses/__init__.py +1 -1
  32. omlish/dataclasses/impl/__init__.py +17 -1
  33. omlish/dataclasses/impl/api.py +10 -11
  34. omlish/dataclasses/impl/as_.py +4 -4
  35. omlish/dataclasses/impl/exceptions.py +1 -1
  36. omlish/dataclasses/impl/fields.py +7 -7
  37. omlish/dataclasses/impl/frozen.py +2 -2
  38. omlish/dataclasses/impl/init.py +5 -5
  39. omlish/dataclasses/impl/internals.py +1 -1
  40. omlish/dataclasses/impl/metaclass.py +1 -1
  41. omlish/dataclasses/impl/order.py +1 -1
  42. omlish/dataclasses/impl/replace.py +1 -1
  43. omlish/dataclasses/impl/repr.py +4 -4
  44. omlish/dataclasses/impl/utils.py +6 -6
  45. omlish/defs.py +13 -17
  46. omlish/{procfs.py → diag/procfs.py} +22 -24
  47. omlish/diag/ps.py +47 -0
  48. omlish/{replserver → diag/replserver}/console.py +18 -20
  49. omlish/{replserver → diag/replserver}/server.py +8 -8
  50. omlish/dispatch/dispatch.py +5 -8
  51. omlish/dispatch/functions.py +1 -1
  52. omlish/dispatch/methods.py +4 -5
  53. omlish/docker.py +1 -1
  54. omlish/dynamic.py +10 -10
  55. omlish/fnpairs.py +400 -0
  56. omlish/graphs/trees.py +13 -13
  57. omlish/inject/__init__.py +7 -7
  58. omlish/inject/elements.py +1 -1
  59. omlish/inject/exceptions.py +7 -7
  60. omlish/inject/impl/elements.py +17 -5
  61. omlish/inject/impl/injector.py +12 -10
  62. omlish/inject/impl/inspect.py +2 -2
  63. omlish/inject/impl/scopes.py +12 -11
  64. omlish/inject/proxy.py +5 -5
  65. omlish/iterators.py +19 -24
  66. omlish/json.py +143 -6
  67. omlish/lang/__init__.py +13 -4
  68. omlish/lang/cached.py +2 -5
  69. omlish/lang/classes/__init__.py +2 -2
  70. omlish/lang/classes/abstract.py +2 -2
  71. omlish/lang/classes/restrict.py +14 -14
  72. omlish/lang/classes/simple.py +1 -1
  73. omlish/lang/classes/virtual.py +5 -5
  74. omlish/lang/clsdct.py +1 -1
  75. omlish/lang/cmp.py +2 -2
  76. omlish/lang/contextmanagers.py +12 -14
  77. omlish/lang/descriptors.py +16 -4
  78. omlish/lang/exceptions.py +1 -1
  79. omlish/lang/functions.py +58 -22
  80. omlish/lang/imports.py +22 -27
  81. omlish/lang/iterables.py +2 -2
  82. omlish/lang/maybes.py +1 -0
  83. omlish/lang/objects.py +15 -9
  84. omlish/lang/resolving.py +1 -1
  85. omlish/lang/strings.py +1 -1
  86. omlish/lang/sys.py +7 -0
  87. omlish/lang/typing.py +3 -3
  88. omlish/libc.py +9 -5
  89. omlish/logs/_abc.py +5 -1
  90. omlish/logs/filters.py +2 -0
  91. omlish/logs/formatters.py +6 -2
  92. omlish/logs/utils.py +1 -1
  93. omlish/marshal/base.py +3 -3
  94. omlish/marshal/exceptions.py +1 -1
  95. omlish/marshal/global_.py +10 -4
  96. omlish/marshal/objects.py +1 -2
  97. omlish/marshal/registries.py +3 -3
  98. omlish/marshal/utils.py +2 -2
  99. omlish/marshal/values.py +1 -1
  100. omlish/math.py +9 -9
  101. omlish/reflect.py +3 -3
  102. omlish/sql/__init__.py +9 -0
  103. omlish/sql/asyncs.py +148 -0
  104. omlish/stats.py +4 -5
  105. omlish/term.py +1 -1
  106. omlish/testing/pydevd.py +28 -6
  107. omlish/testing/pytest/inject/harness.py +1 -1
  108. omlish/testing/pytest/plugins/pydevd.py +1 -1
  109. omlish/testing/pytest/plugins/switches.py +1 -1
  110. omlish/text/delimit.py +3 -6
  111. {omlish-0.0.0.dev2.dist-info → omlish-0.0.0.dev4.dist-info}/METADATA +4 -1
  112. omlish-0.0.0.dev4.dist-info/RECORD +195 -0
  113. {omlish-0.0.0.dev2.dist-info → omlish-0.0.0.dev4.dist-info}/WHEEL +1 -1
  114. omlish/lang/classes/test/test_abstract.py +0 -89
  115. omlish/lang/classes/test/test_restrict.py +0 -71
  116. omlish/lang/classes/test/test_simple.py +0 -58
  117. omlish/lang/classes/test/test_virtual.py +0 -72
  118. omlish-0.0.0.dev2.dist-info/RECORD +0 -193
  119. /omlish/{lang/classes/test → diag}/__init__.py +0 -0
  120. /omlish/{replserver → diag/replserver}/__init__.py +0 -0
  121. /omlish/{replserver → diag/replserver}/__main__.py +0 -0
  122. /omlish/sql/{_abcs.py → _abc.py} +0 -0
  123. {omlish-0.0.0.dev2.dist-info → omlish-0.0.0.dev4.dist-info}/LICENSE +0 -0
  124. {omlish-0.0.0.dev2.dist-info → omlish-0.0.0.dev4.dist-info}/top_level.txt +0 -0
omlish/testing/pydevd.py CHANGED
@@ -5,6 +5,27 @@ an already-debugging PyCharm instance to debug PySpark jobs.
5
5
 
6
6
  TODO:
7
7
  - https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#
8
+ - PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py -> USE_LOW_IMPACT_MONITORING
9
+
10
+ ==
11
+
12
+ https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config ->
13
+
14
+ pycharm_port = 43251
15
+ pycharm_version = '241.18034.82'
16
+ buf = textwrap.dedent(f'''
17
+ import subprocess
18
+ import sys
19
+ subprocess.check_call([sys.executable, '-mpip', 'install', f'pydevd-pycharm~={pycharm_version}'])
20
+
21
+ import pydevd_pycharm # noqa
22
+ pydevd_pycharm.settrace(
23
+ 'docker.for.mac.localhost',
24
+ port={pycharm_port},
25
+ stdoutToServer=True,
26
+ stderrToServer=True,
27
+ )
28
+ ''') + '\n' * 2 + buf
8
29
  """
9
30
  import json
10
31
  import os
@@ -38,14 +59,14 @@ def is_debugger_call(hoist: int = 0, walk: int = 2) -> bool:
38
59
  return False
39
60
 
40
61
 
41
- class DebuggerCallForbiddenException(Exception):
62
+ class DebuggerCallForbiddenError(Exception):
42
63
  pass
43
64
 
44
65
 
45
66
  def forbid_debugger_call(hoist: int = 0) -> None:
46
67
  # FIXME: only reentrant?
47
68
  if not ALLOW_DEBUGGER_CALLS and is_debugger_call(hoist + 1):
48
- raise DebuggerCallForbiddenException
69
+ raise DebuggerCallForbiddenError
49
70
 
50
71
 
51
72
  ##
@@ -60,12 +81,14 @@ def silence_subprocess_check() -> None:
60
81
  return
61
82
 
62
83
  new_tb = lang.proxy_import('traceback')
63
- new_tb.print_exc = lambda *a, **k: None # type: ignore
84
+ new_tb.print_exc = lambda *a, **k: None # type: ignore # noqa
64
85
  pydev_monkey.traceback = new_tb
65
86
 
66
87
 
67
88
  @lang.cached_function
68
89
  def patch_for_trio_asyncio() -> None:
90
+ """Fix for `trio a callable object was expected by call_soon(), got Task`"""
91
+
69
92
  try:
70
93
  import pydevd_nest_asyncio # noqa
71
94
  except ImportError:
@@ -186,9 +209,8 @@ def maybe_reexec(
186
209
  """))
187
210
  file = bootstrap_path
188
211
 
189
- else:
190
- if file is None:
191
- raise ValueError
212
+ elif file is None:
213
+ raise ValueError
192
214
 
193
215
  args = [sys.executable]
194
216
  args.extend(json.loads(os.environ[ARGS_ENV_VAR]))
@@ -141,7 +141,7 @@ class HarnessPlugin:
141
141
  with harness._pytest_scope_manager(PytestScope.CLASS, request): # noqa
142
142
  yield
143
143
 
144
- @pytest.fixture(scope='function', autouse=True)
144
+ @pytest.fixture(scope='function', autouse=True) # noqa
145
145
  def _harness_scope_listener_function(self, harness, request):
146
146
  with harness._pytest_scope_manager(PytestScope.FUNCTION, request): # noqa
147
147
  yield
@@ -9,4 +9,4 @@ class PydevdPlugin:
9
9
  setup = opd.get_setup()
10
10
  if setup is not None:
11
11
  if hasattr(session.config, '_env_timeout'):
12
- session.config._env_timeout = None
12
+ session.config._env_timeout = None # noqa
@@ -13,7 +13,7 @@ from .... import collections as col
13
13
  from ._registry import register
14
14
 
15
15
 
16
- Configable = ta.Union[pytest.FixtureRequest, pytest.Config]
16
+ Configable = pytest.FixtureRequest | pytest.Config
17
17
 
18
18
 
19
19
  SWITCHES = col.OrderedSet([
omlish/text/delimit.py CHANGED
@@ -46,7 +46,7 @@ class DelimitedEscaping:
46
46
  def is_control_char(self, c: str) -> bool:
47
47
  if not len(c) == 1:
48
48
  raise TypeError(c)
49
- return c == self._delimit_char or c == self._quote_char or c == self._escape_char
49
+ return c == self._delimit_char or c == self._quote_char or c == self._escape_char # noqa
50
50
 
51
51
  def contains_escaped_char(self, s: str) -> bool:
52
52
  return any(c in self._all_escaped_chars for c in s)
@@ -94,11 +94,9 @@ class DelimitedEscaping:
94
94
  if isinstance(strs, str):
95
95
  raise TypeError(strs)
96
96
  buf = io.StringIO()
97
- count = 0
98
- for s in strs:
97
+ for count, s in enumerate(strs):
99
98
  if count:
100
99
  buf.write(self._delimit_char)
101
- count += 1
102
100
  if self.contains_escaped_char(s):
103
101
  buf.write(self.quote(s))
104
102
  else:
@@ -137,8 +135,7 @@ class DelimitedEscaping:
137
135
  if c == self._delimit_char:
138
136
  if not quoted:
139
137
  break
140
- else:
141
- buf.write(c)
138
+ buf.write(c)
142
139
  elif c == self._quote_char:
143
140
  if not quoted:
144
141
  raise ValueError(s)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev2
3
+ Version: 0.0.0.dev4
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -24,6 +24,9 @@ Provides-Extra: sql
24
24
  Requires-Dist: sqlalchemy ; extra == 'sql'
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pytest ; extra == 'test'
27
+ Provides-Extra: trio
28
+ Requires-Dist: trio ; extra == 'trio'
29
+ Requires-Dist: trio-asyncio ; extra == 'trio'
27
30
  Provides-Extra: wrapt
28
31
  Requires-Dist: wrapt ; extra == 'wrapt'
29
32
  Provides-Extra: yaml
@@ -0,0 +1,195 @@
1
+ omlish/__about__.py,sha256=NmLFQDO4CRzemxQzOuD9dQdlaNKZkVw4DwBlKkI355I,153
2
+ omlish/__init__.py,sha256=WQMALSGEyPfcQUmuYQkwv3bC_A5v6IfQ6C6rOYETQHA,200
3
+ omlish/argparse.py,sha256=QRQmX9G0-L_nATkFtGHvpd4qrpYzKATdjuFLbBqzJPM,6224
4
+ omlish/c3.py,sha256=yhescciIJWoJ9nIWJSrUOtyqIu4uLyPjRHk8RbAJ3f4,8039
5
+ omlish/cached.py,sha256=i7uWLRrUrE5N1ofzUf9D3OIsxf-dXkgu4OxCep0CCBk,197
6
+ omlish/check.py,sha256=h66jWSwaiuaaIKPI6_pIfolWYYK3WTR43X1CBO5-PQA,5538
7
+ omlish/defs.py,sha256=IvUL5i-iyBh5HUhf-gY6sonw3tIozL8066QL71CnoiY,4729
8
+ omlish/docker.py,sha256=oLyJQg4Mu-k_WfDVP7PU9yK1cI-JCdcrTVjrQg2sQsE,4140
9
+ omlish/dynamic.py,sha256=35C_cCX_Vq2HrHzGk5T-zbrMvmUdiIiwDzDNixczoDo,6541
10
+ omlish/fnpairs.py,sha256=f9UfdkDCvfKLivN1H-eKbdOYe-8y1f2aPB6AuRGKLIM,9124
11
+ omlish/iterators.py,sha256=YJUTyfqY_calFFOU40TEuptYBqKeavi6L6kc2gXn9s4,5524
12
+ omlish/json.py,sha256=ffsWL9o29ejtGoV0kzEMdDPn5gAI0Ezi3CSQasg41uY,6781
13
+ omlish/libc.py,sha256=u0481imCiTFqP_e-v9g0pD-0WD249j5vYzhtn-fnNkY,15308
14
+ omlish/math.py,sha256=AVqp5Y8yxKA-wO0BgrzaxA0Ga3PZiCXnYcwivMneC-0,3804
15
+ omlish/os.py,sha256=T77P7_U7jShPXsm_byvXwPoumcmtA0a7KPRvE2GAOhw,950
16
+ omlish/reflect.py,sha256=3dJ9ZGrBan5RRW_Q0OTbl9--oi3B05-ZV4uu0VH-m1c,9891
17
+ omlish/runmodule.py,sha256=PWvuAaJ9wQQn6bx9ftEL3_d04DyotNn8dR_twm2pgw0,700
18
+ omlish/stats.py,sha256=uqjN-focDVssFZMagj22HqmyJ1TBO4Wt-XnHp8-EtVw,9927
19
+ omlish/term.py,sha256=OmD3QXntycYHNDCZ-ZV5x2Rz9tw49CoYEn-rld7x_r8,5963
20
+ omlish/asyncs/__init__.py,sha256=e7cMiu0S-Rqg98TT7NBVNZ_DkScqRBqJLxI7Aeb5ToY,680
21
+ omlish/asyncs/anyio.py,sha256=oYU7FGxMlzPhj5Aa1p7XSdKeD6icoyTPxZRWDc9-YGc,3226
22
+ omlish/asyncs/asyncio.py,sha256=pSldCmtE9AgVATXb_Vnhjhhz0v2LtqgVXxe7-OFjH0g,414
23
+ omlish/asyncs/asyncs.py,sha256=MmIz8Gw4PbZd0LUIro_u5kUjobR8i2qGCo6l2hb4U74,2014
24
+ omlish/asyncs/flavors.py,sha256=c8w0M_lTtpm38Vi78cy2jk6pRH7MH_DgR_H9z6PoCpE,4247
25
+ omlish/asyncs/futures.py,sha256=3KkTj5TOPmvNOcuK9LtOQwmkuLzoEYQfcuaHTXSQ0Ts,5424
26
+ omlish/asyncs/trio.py,sha256=GKG3wgelFr7gIKKHZhcflvMyCvxXHNZe862KB0Xw2uA,370
27
+ omlish/asyncs/trio_asyncio.py,sha256=-CV9hjjIl3JcLIDhcRNkhoNhbVLIyzoJFe-_dvyOyc0,1112
28
+ omlish/collections/__init__.py,sha256=H1_J6VNBqdmdMb8vjc7LBJ8ULoiawxoz-1cR41twB2k,1526
29
+ omlish/collections/_abc.py,sha256=sP7BpTVhx6s6C59mTFeosBi4rHOWC6tbFBYbxdZmvh0,2365
30
+ omlish/collections/_io_abc.py,sha256=Cxs8KB1B_69rxpUYxI-MTsilAmNooJJn3w07DKqYKkE,1255
31
+ omlish/collections/coerce.py,sha256=o11AMrUiyoadd8WkdqeKPIpXf2xd0LyylzNCyJivCLU,7036
32
+ omlish/collections/frozen.py,sha256=DGxemj_pVID85tSBm-Wns_x4ov0wOEIT6X5bVgJtmkA,4152
33
+ omlish/collections/identity.py,sha256=3X4J-LqdzM-9QA1bJ_FIxqxsei_ESS3oJHFlD1VX7KQ,2550
34
+ omlish/collections/indexed.py,sha256=lbMBqMjwy8VRZhEsh0o_PIkP9mk4LP3MHQZxa18Hlzg,2143
35
+ omlish/collections/mappings.py,sha256=5D7xZabUY6n1nB-BrZlcrPy_AdzLZ6IyihuLeDL48pA,3188
36
+ omlish/collections/ordered.py,sha256=RzEC3fHvrDeJQSWThVDNYQKke263Vje1II5YwtDwT1Q,2335
37
+ omlish/collections/persistent.py,sha256=KG471s0bhhReQrjlmX0xaN9HeAIcrtT264ddZCxsExo,875
38
+ omlish/collections/skiplist.py,sha256=xjuKZtSScp1VnOi9lpf7I090vGp1DnjA5ELjFhMeGps,5987
39
+ omlish/collections/sorted.py,sha256=E5ZOdNn7Jju1EcQ7CX2Ltk9StIXsBOzqvh7EsT3ZA2U,3354
40
+ omlish/collections/treap.py,sha256=wq9L5hvxq4QgPvIpHmueZMF8t7UrvX5vmlNN4BOqY4g,7720
41
+ omlish/collections/treapmap.py,sha256=TxOM-ZRF5PK2xe5wRIhESNt7DGh9b_MeZfE7HLkCOs4,5804
42
+ omlish/collections/unmodifiable.py,sha256=QmUEi9IBXqiM_KGgH2rqg15VmkHJo1MZ6kwq2twEMho,4750
43
+ omlish/collections/utils.py,sha256=2mqczC8lnIfpuYxdBJACqRqXup5YGcVNhwgw2r5MVy4,3022
44
+ omlish/collections/cache/__init__.py,sha256=Cv8RX-Ehit3um0QLDq7uRDqJUCcdqTKoAB9T0pM_5hg,392
45
+ omlish/collections/cache/descriptor.py,sha256=t-1Gh4DTABDuNmeDJlpoW4LV3gi_uSlBd9ZfBINfYCM,5023
46
+ omlish/collections/cache/impl.py,sha256=WDmF_WSGpVsFRbUAB7GMAA-z5-nr7rGNB7TiKfK53dY,15129
47
+ omlish/collections/cache/types.py,sha256=yNjwd6CGyTJQdxN2CQxFqqBAlcs1Z7vvNV-aU1K7p8E,685
48
+ omlish/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ omlish/configs/flattening.py,sha256=AOlRpBHm449MxwMp3CiIRGunStOC1DUNs1f3CLou0wc,4731
50
+ omlish/configs/props.py,sha256=nwbg4uzFMbiNnTxOhRQ67AREbrLB8lMoiGMjmjjdVBE,1693
51
+ omlish/dataclasses/__init__.py,sha256=xx4l1C6bgo75DMcZZwhIJr9UZpo8LranMqa_1hOkiMk,972
52
+ omlish/dataclasses/impl/__init__.py,sha256=rQJRcE9fVsGEvRUOZ18r4DE0xiLbSRjspyJRXgbLS3I,348
53
+ omlish/dataclasses/impl/api.py,sha256=7w-SXif9e2Driz_HyR2depJRQL76EwRai3jdNrQAjB0,6243
54
+ omlish/dataclasses/impl/as_.py,sha256=lXSMsRgzsewSaub8SUmNXvxVRsDpeAOhL1xMOK-d4RI,2598
55
+ omlish/dataclasses/impl/exceptions.py,sha256=EDuVPeyjBu8jHYUFIASRNupRL-krpytSeuNIkD4N6Ok,38
56
+ omlish/dataclasses/impl/fields.py,sha256=_ICwU0aCYLQYV5i0gmO3bLJlyMG4OxOa89xemPY_gcQ,4242
57
+ omlish/dataclasses/impl/frozen.py,sha256=5wKtt8WvPYCkHPrwR024mpvbFzqcbPQfgiFvy3orRJo,1692
58
+ omlish/dataclasses/impl/hashing.py,sha256=FKnHuXCg9ylrzK2TLGqO5yfRN4HX3F415CSLlVYXtYE,3190
59
+ omlish/dataclasses/impl/init.py,sha256=O5UAUysLKWPg3e4KiJ5Dsv8CJnrdwJErMWkgQVERXpA,5558
60
+ omlish/dataclasses/impl/internals.py,sha256=LTCqGT8AhyGTWwioGrBpTJzDzPvAtizQKb0NBNKcNs0,2989
61
+ omlish/dataclasses/impl/main.py,sha256=gANq32eOkNXWDLdJ3MgPFKiviE-m0ao8ryjF52Hg1xs,5129
62
+ omlish/dataclasses/impl/metaclass.py,sha256=UaNdJjD-Y6aJ178Et5_1erORsJ9PzO1xfR0K5rGOCjs,2722
63
+ omlish/dataclasses/impl/metadata.py,sha256=HGqAtMcP422X4kPx93btcxE-n4guBFm6-N-S4nobgk4,1407
64
+ omlish/dataclasses/impl/order.py,sha256=8aWqDgf4sPhn04tdAaFwA8tjvuIhf2D8f4mpk5LvPqw,1369
65
+ omlish/dataclasses/impl/params.py,sha256=M-xg9IeFftVy795oqlp7Yw8jE-7wG2K4vaFhXHKmL1k,2538
66
+ omlish/dataclasses/impl/processing.py,sha256=iUvaNwRAt8rQsLIIkvRye5rfk6xhgR35EbcdwZCZec8,366
67
+ omlish/dataclasses/impl/reflect.py,sha256=nw8OkZkVloQEhpIwXkuQAIQKT8XxI_eOmi0ZNAIb_IY,5000
68
+ omlish/dataclasses/impl/replace.py,sha256=wS9GHX4fIwaPv1JBJzIewdBfXyK3X3V7_t55Da87dYo,1217
69
+ omlish/dataclasses/impl/repr.py,sha256=oLXBTxqp88NKmz82HrJeGiTEiwK4l5LlXQT9Q0-tX3c,1605
70
+ omlish/dataclasses/impl/simple.py,sha256=EovA-GpmQYtB_svItO2byTAWqbKGF4njz0MdQts3QBU,3157
71
+ omlish/dataclasses/impl/slots.py,sha256=_sm-x9v1tPnXEHBHNUMTHZocgVyhZaPdvamIPPBUVyk,2635
72
+ omlish/dataclasses/impl/utils.py,sha256=aER2iL3UAtgS1BdLuEvTr9Tr2wC28wk1kiOeO-jIymw,6138
73
+ omlish/diag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
+ omlish/diag/procfs.py,sha256=94o3xDtJn4PWsUUwZjnE7m0aJM80rykDssG_R1OH98w,9274
75
+ omlish/diag/ps.py,sha256=1JWxZen3fVG-20R6ZZ8BtO_gpzw_5bhHZiKdoHkgxoU,1004
76
+ omlish/diag/replserver/__init__.py,sha256=uLo6V2aQ29v9z3IMELlPDSlG3_2iOT4-_X8VniF-EgE,235
77
+ omlish/diag/replserver/__main__.py,sha256=LmU41lQ58bm1h4Mx7S8zhE_uEBSC6kPcp9mn5JRpulA,32
78
+ omlish/diag/replserver/console.py,sha256=hzY3sCpUF_C9Nvlc5QT75OqHbfnPQkUz3keWRMITmjY,7396
79
+ omlish/diag/replserver/server.py,sha256=L8qHxVx4JBPzWs18m2t82fW0Uloi7Kvv7xnUGyN1pAk,4865
80
+ omlish/dispatch/__init__.py,sha256=GsiGJ91NKiQptSROtnCSkrZExBkvfDwYvdoTu5dBqF0,117
81
+ omlish/dispatch/dispatch.py,sha256=8B66wOat30HckcIsCq4pnutBy20iSPwPQOqJ4msHaGU,3739
82
+ omlish/dispatch/functions.py,sha256=S8ElsLi6DKxTdtFGigWaF0vAquwy2sK-3f4iRLaYq70,1522
83
+ omlish/dispatch/methods.py,sha256=utLvLioBgEqa0gR0fpfNEtMDZFGPM4G5p3XHnPt-oIw,5865
84
+ omlish/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
+ omlish/graphs/trees.py,sha256=_N8Z-gBVzreY0NWpzzitD4iR3e40ojoFLVXjJlGViTI,8150
86
+ omlish/graphs/dot/__init__.py,sha256=6-LAx7ytHFQvfLrnxVQG1s8xmApgblERJJCTB2knOHk,642
87
+ omlish/graphs/dot/items.py,sha256=OWPf0-hjBgS1uyy2QgAEn4IgFHJcEg7sHVWeTx1ghZc,4083
88
+ omlish/graphs/dot/rendering.py,sha256=hUSJ5HvSvxnTIC9ynSxxP8IJnVH6quEeDbLzNlUnmuk,3626
89
+ omlish/graphs/dot/utils.py,sha256=_FMwn77WfiiAfLsRTOKWm4IYbNv5kQN22YJ5psw6CWg,801
90
+ omlish/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
91
+ omlish/http/consts.py,sha256=reOpgv7NHAHLqUblYgfT5-hZVngkZfMJfCz9P41JdlU,696
92
+ omlish/http/wsgi.py,sha256=czZsVUX-l2YTlMrUjKN49wRoP4rVpS0qpeBn4O5BoMY,948
93
+ omlish/inject/__init__.py,sha256=kgHhZHYW-A1z99HhBKsk13RrjQXFL1-JjfU3hF3IQ4M,1207
94
+ omlish/inject/binder.py,sha256=hkT2dw_VSOkYTP4Mn1gvEFKeWPb-O_koFeSSsB8eNx4,278
95
+ omlish/inject/bindings.py,sha256=_GeM_w-QdPa_UMeVFluuGPf-9UCzvOqzo1gL0AEfqtc,1129
96
+ omlish/inject/eagers.py,sha256=ITpV2FoIzP2xJs4XtzEKTWP0QktLw1aPSWTxmNVJcPA,372
97
+ omlish/inject/elements.py,sha256=HXG5rt2IMczK3eJCkEhj73wcCIliJnqFzQv3evPwOGI,957
98
+ omlish/inject/exceptions.py,sha256=UCNc8s8O6_2c28VeqvB7oVR2SmnnXb55Vd0MWx-YS20,612
99
+ omlish/inject/injector.py,sha256=ewnyHj50KfanQFJU8Il2MtulpaHQYgXuDZMqWud_IHE,927
100
+ omlish/inject/inspect.py,sha256=PriB5cqqTYSz_FnLxoxIRAOp9fR9CMSILfvh-V26wxA,206
101
+ omlish/inject/keys.py,sha256=ihDlt4b8mPNRyEmg2EOEsTQ7e4NSVh7nVDq2JEC4OVY,759
102
+ omlish/inject/managed.py,sha256=hXVl8eLMrCaEwPv6glB9Dfr5EM_y1fBQwrZ2eu2XxsQ,627
103
+ omlish/inject/overrides.py,sha256=k-WjyslF-pZmsYwzrDDsFNgqcl0Ao3CufHCoN0LDCAU,391
104
+ omlish/inject/private.py,sha256=brBCsI-lZHPoouAij7_Eja44nkT-HxweG6eSVIhtXMA,592
105
+ omlish/inject/providers.py,sha256=VKc2vKiJN4GdWn7Vp1Su3zTBZe2PnH0h256qusrHMnU,1999
106
+ omlish/inject/proxy.py,sha256=4ACSV3iy0lIbMvM3dZUCG6BnmmOTAVqA4mvjRxlcdX8,1634
107
+ omlish/inject/scopes.py,sha256=hecYiZwZ3H31cnTgfP01-duTM8OgllwxtvQKpzyHDSU,2033
108
+ omlish/inject/types.py,sha256=CP3ltWxRtmR2Iqz1Qd7CvaTHQYV4st5FPiNDBN8tmn0,235
109
+ omlish/inject/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
+ omlish/inject/impl/bindings.py,sha256=8H586RCgmvwq53XBL9WMbb-1-Tdw_hh9zxIDCwcHA1c,414
111
+ omlish/inject/impl/elements.py,sha256=f_eGd-AbyBO0g7Qsu8gA-IKPVKWSUOZcD2MbXxISXoE,4898
112
+ omlish/inject/impl/injector.py,sha256=DeweCOLcij_kYkY1g6i3gjcJ2FSTAe83fO4vnbX7Qmo,5639
113
+ omlish/inject/impl/inspect.py,sha256=ZQScAStbjWi_5InA6M52ll3cdyfPRuLwYo6kc4kFsmM,2525
114
+ omlish/inject/impl/private.py,sha256=MiYvs-EiFrla4FQnoqmqGpYx784ij33p0obAS57HOCQ,2611
115
+ omlish/inject/impl/providers.py,sha256=m0c9AAY849P6egYBOsSCkSoSBc8So7Zbmlo6gZwzTIw,3302
116
+ omlish/inject/impl/scopes.py,sha256=itwf_r8hhiYZVHHAzAvAEKRza4M2ST8LJJLOHrhSM2c,5711
117
+ omlish/lang/__init__.py,sha256=mqnnt6K54ROzSLWVJZrLz51ufcSM66RUy9jPtczjegI,2768
118
+ omlish/lang/cached.py,sha256=MgBHfT83Rrl8tFr98hGBgEeA3ugse077_w6n3S35QYM,7603
119
+ omlish/lang/clsdct.py,sha256=LXwLCULeI_8Np-7-pZkyNAHpUZLcQiBEQiHwKYQ0WRo,1742
120
+ omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
121
+ omlish/lang/contextmanagers.py,sha256=bbtQM8qK8dXAiGzNHdpXfIqFTyr9i5cgxeI5PoD6x60,6071
122
+ omlish/lang/datetimes.py,sha256=vZ-wZXcQUuYKv59FcWfBD36d5DiHUDG5nIPW8-nhYng,2022
123
+ omlish/lang/descriptors.py,sha256=dJ5wQlKK3H-gyddFnmDO8_IOQ290SR7VxFyF-RdV2FE,2056
124
+ omlish/lang/exceptions.py,sha256=qJBo3NU1mOWWm-NhQUHCY5feYXR3arZVyEHinLsmRH4,47
125
+ omlish/lang/functions.py,sha256=wN21Uyxt4zmT4MH6VWNsKsf8-oBphvVW-cd8KQXwfJs,3858
126
+ omlish/lang/imports.py,sha256=f_Dqv4aMasl_UiEc3CJ-4t-cRaRjkUtFzfofNbDrn7M,4093
127
+ omlish/lang/iterables.py,sha256=_WK-AvXOUUVOk5073uqCKc48vH8uXI_vNV5o5OOgiUU,1034
128
+ omlish/lang/maybes.py,sha256=J2N3IDOnSSeGbrN342ln2adt0TDpz2SkyCIiZ0pVRDQ,3425
129
+ omlish/lang/objects.py,sha256=TAD84PYsD0cGtaQpqo3fQSm99tP4-hckixkQ_K_Iaic,2820
130
+ omlish/lang/resolving.py,sha256=UgrX-vxXtCGGEmnAMUYP4bUZ6-Ok0EcHVEKAZYbAS-o,1597
131
+ omlish/lang/strings.py,sha256=wdLo3m9GkV76ZKak3QqtwiR6rWqUd1XlZ-divZppcek,2372
132
+ omlish/lang/sys.py,sha256=Q316Bzy9cC6bFwztkgpc8CKnsCaz4ldYvjIGpTXlxf4,145
133
+ omlish/lang/timeouts.py,sha256=vECdWYhc_IZgcal1Ng1Y42wf2FV3KAx-i8As-MgGHIQ,1186
134
+ omlish/lang/typing.py,sha256=pN7Eh8X-1iDqaZ_nZQJaheHBYdkuYTSs0yCN0LcKfDU,2341
135
+ omlish/lang/classes/__init__.py,sha256=j1p0_uuMznKrY2EhMoj20uv6vx4LXljMzp7AaKe0mmU,530
136
+ omlish/lang/classes/abstract.py,sha256=goIV14oY24EOs88eVe6E6NyrSPOOLMOcWTXTMuYKiqc,2304
137
+ omlish/lang/classes/restrict.py,sha256=Fb18KwWo-o7N0OEXpomzsdQpQvJZIK_dAf4d4oAiTsk,3108
138
+ omlish/lang/classes/simple.py,sha256=p30A4dJxXrtG3ztRF50uBZoBwt84hMqOt_c7cyNx5ec,2672
139
+ omlish/lang/classes/virtual.py,sha256=hEVeosXKwG4sK_9dqBoNjkK2jF2mV9QoZGOtLqg7L_Q,3315
140
+ omlish/logs/__init__.py,sha256=V8jEdb5rj9Dli0b9qtR0ZYstRoIlxWqbU38UmEOXbfY,419
141
+ omlish/logs/_abc.py,sha256=UgrCUQVUi_PvT3p1CEkb3P74CFrFcZq2AFby3GEUv9M,5974
142
+ omlish/logs/configs.py,sha256=vW4QMZKqeEBbtQY0JEi-VKBIt0CuLgcGDgG8aTlgmC0,1762
143
+ omlish/logs/filters.py,sha256=dk-_sRQhp_rCGF48qpPj5viHOBEOu78quXe9pHHs78c,187
144
+ omlish/logs/formatters.py,sha256=sFboMGuDdK-FuLc13KJ0gexvLrPz2nuzlajGiStVRQw,1905
145
+ omlish/logs/utils.py,sha256=xDSt0bMv9VPPsMxHGQNG5mPw53VgmC9u2biBi9ghr34,392
146
+ omlish/marshal/__init__.py,sha256=8kNPJUBApx6pt2-M3wiaC0o3JXF-c9nu8MUZ_h_fg4E,821
147
+ omlish/marshal/any.py,sha256=uWGEeBWaJvh5hjaGKIBL0ogGCg1jKH0Rq_onECYpHVs,821
148
+ omlish/marshal/base.py,sha256=w1zfL-eU5ZvVsoPWOwy_P8qi3VcxgI4I_3NuHNFUeww,5124
149
+ omlish/marshal/base64.py,sha256=kdkkFXjYaKx6iHxMM_7vYfaX-KUM3wXN3vzsOmBbou4,863
150
+ omlish/marshal/dataclasses.py,sha256=uTjpSxRtVJLWJr5-Bmb_PMGpRhr2gJjaL3oR2pToR1I,3522
151
+ omlish/marshal/datetimes.py,sha256=5q1CQEadI5OMDYrToHNrl3NyIuD_0GAohCgKU-HjkEs,2287
152
+ omlish/marshal/enums.py,sha256=xItDDXHoIsCL_wnhRZmTpK1zy6P0dYouOcbfPGFvyxE,1224
153
+ omlish/marshal/exceptions.py,sha256=5ub1eA0Wfd3gs8mT8XbPvPdqMVFUoCJfxvgbIjI5Uo0,142
154
+ omlish/marshal/factories.py,sha256=4Vt5Vr4r_toZQHGt_fTmcmG-gJoaZcpr6GJMU1P2lhA,2932
155
+ omlish/marshal/global_.py,sha256=kbq8gzjsKLlkieboQ-mYibPNrUGdb_kOt4Dzcmk3I4Y,881
156
+ omlish/marshal/iterables.py,sha256=ZHmvT79_i2m4bCahcuEE9aeeOukjtZhYnROCnxP53y8,2168
157
+ omlish/marshal/mappings.py,sha256=4bh1pdbvUh42Xp3mWQQa4J6da7MADmsuO029uqIYk3w,2469
158
+ omlish/marshal/naming.py,sha256=QQtw_w_YuJr4Fg-tihonOaQn_XCNixMdtgMHaRkSq6w,325
159
+ omlish/marshal/objects.py,sha256=wbcZDDzG1j3nRdHEVWb9cZiRosx06IsUnIxH5YF515w,2739
160
+ omlish/marshal/optionals.py,sha256=zZN34AGXkHobJRzM1g4UcW6jw82La8moPH5tmyxy9rc,1508
161
+ omlish/marshal/polymorphism.py,sha256=9sFTwrAjqJ4J7lRAXQZgV1jucSkgeQd7IHs4xJnEDLE,3858
162
+ omlish/marshal/primitives.py,sha256=N7kXrdxz5CIrDnPnsYMdo0xLjEfMnVfKXLMANDu-L6Y,1139
163
+ omlish/marshal/registries.py,sha256=GI2KogcxawMkk02Ky7-TsnijChoe1I7YTOPIbUNwSAI,1665
164
+ omlish/marshal/standard.py,sha256=MPmtJH3B_LqeoSwQsxKjUm65-cq6albBc8z-gxyKAj4,2442
165
+ omlish/marshal/utils.py,sha256=puKJpwPpuDlMOIrKMcLTRLJyMiL6n_Xs-p59AuDEymA,543
166
+ omlish/marshal/uuids.py,sha256=_htkeMt1a6FUNBlstZIy2rrB1-1DiavV5dZrjSQNYVM,952
167
+ omlish/marshal/values.py,sha256=ssHiWdg_L6M17kAn8GiGdPW7UeQOm3RDikWkvwblf5I,263
168
+ omlish/sql/__init__.py,sha256=pLv2EQmAwcGXN0Y3AE8K5JjyN_4GaHRMHyExaDFm5yU,181
169
+ omlish/sql/_abc.py,sha256=HLhnnLZ7l0r_N99I-RCqJe6VHth-9iluU7cR-7-5jfs,1519
170
+ omlish/sql/asyncs.py,sha256=Wye3dwh7oZEGYz2Y4DZQSHtW4xjI2AH5qjW-BSS2IfU,3688
171
+ omlish/sql/dbs.py,sha256=JxcJm3JIcsb7i-t9L0KU9WhAc26QsKUL6ZL6puy3IXI,1763
172
+ omlish/testing/__init__.py,sha256=l13axR7dyVE9T1e6w1pMYtAkW3vS2J97nBcYQ1FUv18,136
173
+ omlish/testing/pydevd.py,sha256=xOeAithe-XMiwhc0sqnmVe4FRfr2DOkKVgSH0jp5C0U,6352
174
+ omlish/testing/testing.py,sha256=TaLELNrPx42_-EEqJygDYyQOtEdjXP4KqgLGu6juHmU,2470
175
+ omlish/testing/pytest/__init__.py,sha256=diebkOX565JdY7HIDMJVLlj3pcFnlK-spv6YIlD77oA,176
176
+ omlish/testing/pytest/helpers.py,sha256=DKZXQGqKpDiQAh0SuYrzvJ8usJbTnuVQFDpuDmQD_Oc,912
177
+ omlish/testing/pytest/inject/__init__.py,sha256=pdRKv1HcDmJ_yArKJbYITPXXZthRSGgBJWqITr0Er38,117
178
+ omlish/testing/pytest/inject/harness.py,sha256=-zeQIeD9NvpTo9DNbkb_jv_dPMrSCUbj8UDQrZ4cCPs,5042
179
+ omlish/testing/pytest/plugins/__init__.py,sha256=BVXbNpxBMvncdMoyfuVAnnV9DqCdvrICC5zY6bzYVDQ,374
180
+ omlish/testing/pytest/plugins/_registry.py,sha256=IK04KlBgiOJxKAyCCgjpX2R-9tE-btalYJkgjLc8Te8,77
181
+ omlish/testing/pytest/plugins/logging.py,sha256=1zs6Xe54wiaSjabCviaFXwKkoN97CKm3mA5mEoUeJGs,380
182
+ omlish/testing/pytest/plugins/pydevd.py,sha256=xCBAbBmn-WGwSzLCgUZlAXM6c0fWChydoUf2Lr5SERg,314
183
+ omlish/testing/pytest/plugins/repeat.py,sha256=flSQzE9GFOWksVKz-mUGnpxJpv3yRqn1G4K8pW7JHs0,498
184
+ omlish/testing/pytest/plugins/skips.py,sha256=EoZDg1uWccgbAegmzqI85c7RliycD1e2J4Y7vfDRhwM,1041
185
+ omlish/testing/pytest/plugins/spacing.py,sha256=JQQhi9q3c523Ro1a_K_9RGAb7HotiO74N8bYX2VESFE,707
186
+ omlish/testing/pytest/plugins/switches.py,sha256=qeCp3aDtZjnh6-po1FU4JEKCrR97q0MI9nJmIF_LRkg,1809
187
+ omlish/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
188
+ omlish/text/delimit.py,sha256=gAdbVES35IT-maH_M084SJEaf1LRoyXG8Z3pIS6OSCI,4878
189
+ omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
190
+ omlish/text/parts.py,sha256=KGgo0wHOIMVMZtDso-rhSWKAcAkYAH2IGpg9tULabu8,6505
191
+ omlish-0.0.0.dev4.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
192
+ omlish-0.0.0.dev4.dist-info/METADATA,sha256=nuRX2RRNrFfyR75hu2D3EK0MrAlueKOhq6dBz6khV-o,1058
193
+ omlish-0.0.0.dev4.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
194
+ omlish-0.0.0.dev4.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
195
+ omlish-0.0.0.dev4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.3.0)
2
+ Generator: setuptools (71.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,89 +0,0 @@
1
- import abc
2
-
3
- import pytest
4
-
5
- from ..abstract import Abstract
6
- from ..abstract import is_abstract
7
-
8
-
9
- def test_abstract():
10
- class C(Abstract):
11
- pass
12
-
13
- class D(C):
14
- pass
15
-
16
- class E(D, Abstract):
17
- pass
18
-
19
- class F(E):
20
- pass
21
-
22
- with pytest.raises(TypeError):
23
- C()
24
- D()
25
- with pytest.raises(TypeError):
26
- E()
27
- F()
28
-
29
-
30
- def test_abstract2():
31
- class O(Abstract):
32
- pass
33
-
34
- assert is_abstract(O)
35
-
36
- with pytest.raises(TypeError):
37
- O()
38
-
39
- class A(Abstract):
40
- @abc.abstractmethod
41
- def f(self):
42
- pass
43
-
44
- assert is_abstract(A)
45
-
46
- with pytest.raises(TypeError):
47
- A() # type: ignore
48
-
49
- class B(A, Abstract):
50
- pass
51
-
52
- with pytest.raises(TypeError):
53
- B() # type: ignore
54
-
55
- class C(B):
56
- f = 0
57
-
58
- assert C()
59
-
60
- with pytest.raises(TypeError):
61
- class D(A):
62
- pass
63
-
64
-
65
- def test_is_abstract():
66
- class A(Abstract):
67
- pass
68
-
69
- assert is_abstract(A)
70
-
71
- class B(A):
72
- pass
73
-
74
- assert not is_abstract(B)
75
-
76
- class C(Abstract):
77
-
78
- def __init_subclass__(cls, **kwargs):
79
- super().__init_subclass__(**kwargs)
80
- if cls.__name__ == 'D':
81
- assert is_abstract(cls)
82
- else:
83
- assert not is_abstract(cls)
84
-
85
- class D(C, Abstract):
86
- pass
87
-
88
- class E(D):
89
- pass
@@ -1,71 +0,0 @@
1
- import typing as ta
2
-
3
- import pytest
4
-
5
- from ..restrict import Final
6
- from ..restrict import FinalException
7
- from ..restrict import NoBool
8
- from ..restrict import Sealed
9
- from ..restrict import SealedException
10
- from ..restrict import no_bool
11
-
12
-
13
- def test_final():
14
- class A:
15
- pass
16
-
17
- A()
18
-
19
- class B(A, Final):
20
- pass
21
-
22
- B()
23
-
24
- with pytest.raises(FinalException):
25
- class C(B):
26
- pass
27
-
28
- T = ta.TypeVar('T')
29
-
30
- class D(ta.Generic[T], Final):
31
- pass
32
-
33
- D()
34
- D[int] # noqa
35
-
36
- with pytest.raises(FinalException):
37
- class E(D[int]):
38
- pass
39
-
40
-
41
- def test_sealed():
42
- class A(Sealed):
43
- __module__ = 'a'
44
-
45
- class B(A):
46
- __module__ = 'a'
47
-
48
- with pytest.raises(SealedException):
49
- class C(A):
50
- __module__ = 'c'
51
-
52
- class D(B):
53
- __module__ = 'd'
54
-
55
-
56
- def test_no_bool():
57
- @no_bool
58
- def f():
59
- return 1
60
-
61
- assert f() == 1
62
- assert bool(f())
63
- with pytest.raises(TypeError):
64
- bool(f)
65
-
66
- class C(NoBool):
67
- pass
68
-
69
- assert C # type: ignore
70
- with pytest.raises(TypeError):
71
- bool(C())
@@ -1,58 +0,0 @@
1
- import pytest
2
-
3
- from ..restrict import FinalException
4
- from ..simple import LazySingleton
5
- from ..simple import Marker
6
- from ..simple import Singleton
7
-
8
-
9
- def test_marker():
10
- class M(Marker):
11
- pass
12
-
13
- with pytest.raises(FinalException):
14
- class N(M):
15
- pass
16
- with pytest.raises(TypeError):
17
- M()
18
-
19
- assert repr(M) == '<M>'
20
-
21
- assert isinstance(M, M)
22
- assert issubclass(M, M) # noqa
23
-
24
- class O(Marker):
25
- pass
26
-
27
- assert isinstance(O, O)
28
- assert issubclass(O, O) # noqa
29
-
30
- assert not isinstance(M, O)
31
- assert not issubclass(M, O)
32
- assert not isinstance(O, M)
33
- assert not issubclass(O, M)
34
-
35
-
36
- def test_singletons():
37
- for bcls in [Singleton, LazySingleton]:
38
- foo_init_calls = 0
39
- foo2_init_calls = 0
40
-
41
- class Foo(bcls): # type: ignore
42
- def __init__(self):
43
- super().__init__()
44
- nonlocal foo_init_calls
45
- foo_init_calls += 1
46
-
47
- assert Foo() is Foo()
48
- assert foo_init_calls == 1
49
-
50
- class Foo2(Foo):
51
- def __init__(self):
52
- super().__init__()
53
- nonlocal foo2_init_calls
54
- foo2_init_calls += 1
55
-
56
- assert Foo2() is Foo2()
57
- assert foo2_init_calls == 1
58
- assert foo_init_calls == 2
@@ -1,72 +0,0 @@
1
- import abc
2
-
3
- import pytest
4
-
5
- from ..virtual import Callable
6
- from ..virtual import Virtual
7
- from ..virtual import virtual_check
8
-
9
-
10
- def test_virtual():
11
- class P(Virtual):
12
- @abc.abstractmethod
13
- def f(self):
14
- raise NotImplementedError
15
-
16
- with pytest.raises(TypeError):
17
- P() # type: ignore
18
-
19
- class A:
20
- def f(self):
21
- pass
22
-
23
- class B:
24
- def g(self):
25
- pass
26
-
27
- A()
28
-
29
- assert issubclass(A, P)
30
- assert not issubclass(B, P)
31
- assert isinstance(A(), P)
32
- assert not isinstance(B(), P)
33
-
34
- class C(P):
35
- def f(self):
36
- pass
37
-
38
- with pytest.raises(TypeError):
39
- class D(P):
40
- pass
41
-
42
- D() # type: ignore
43
-
44
- virtual_check(P)(A)
45
- with pytest.raises(TypeError):
46
- virtual_check(P)(B)
47
-
48
-
49
- def test_callable():
50
- with pytest.raises(Exception):
51
- Callable()
52
-
53
- with pytest.raises(Exception):
54
- class C(Callable): # noqa
55
- pass
56
-
57
- def f():
58
- pass
59
-
60
- assert isinstance(f, Callable)
61
- assert not isinstance(5, Callable)
62
-
63
- class D:
64
- pass
65
-
66
- class E:
67
- def __call__(self):
68
- pass
69
-
70
- assert isinstance(D, Callable)
71
- assert isinstance(E, Callable)
72
- assert isinstance(E(), Callable)