omlish 0.0.0.dev290__py3-none-any.whl → 0.0.0.dev291__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.
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev290'
2
- __revision__ = 'ebbb2a4babf1f763c1caf685dbe12bcde2fa251f'
1
+ __version__ = '0.0.0.dev291'
2
+ __revision__ = '8d0ee885f143f757a01fdd52c57e6c1d2736d375'
3
3
 
4
4
 
5
5
  #
@@ -16,12 +16,14 @@ from .impls import get_impl_func_cls_set
16
16
 
17
17
 
18
18
  T = ta.TypeVar('T')
19
+ R = ta.TypeVar('R')
20
+ P = ta.ParamSpec('P')
19
21
 
20
22
 
21
23
  ##
22
24
 
23
25
 
24
- class Method:
26
+ class Method(ta.Generic[P, R]):
25
27
  def __init__(
26
28
  self,
27
29
  func: ta.Callable,
@@ -170,13 +172,27 @@ class Method:
170
172
  func = self.get_dispatch_func(instance_cls)
171
173
  return func.__get__(instance, owner) # noqa
172
174
 
173
- def __call__(self, instance, *args, **kwargs):
175
+ def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R:
176
+ instance, *rest = args
174
177
  instance_cls = type(instance)
175
178
  try:
176
179
  func = self._dispatch_func_cache[weakref.ref(instance_cls)]
177
180
  except KeyError:
178
181
  func = self.get_dispatch_func(instance_cls)
179
- return func.__get__(instance)(*args, **kwargs) # noqa
182
+ return func.__get__(instance)(*rest, **kwargs) # noqa
183
+
184
+
185
+ ##
186
+
187
+
188
+ @ta.overload
189
+ def method(func: ta.Callable[P, R], /, *, installable: bool = False) -> Method[P, R]: # noqa
190
+ ...
191
+
192
+
193
+ @ta.overload
194
+ def method(func: None = None, /, *, installable: bool = False) -> ta.Callable[[ta.Callable[P, R]], Method[P, R]]: # noqa
195
+ ...
180
196
 
181
197
 
182
198
  def method(func=None, /, *, installable=False): # noqa
@@ -186,6 +202,9 @@ def method(func=None, /, *, installable=False): # noqa
186
202
  return Method(func, **kw)
187
203
 
188
204
 
205
+ #
206
+
207
+
189
208
  def install_method(
190
209
  mth: ta.Any,
191
210
  *,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish
3
- Version: 0.0.0.dev290
3
+ Version: 0.0.0.dev291
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=pjGUyLHaoWpPqRP3jz2u1fC1qoRc2lvrEcpU_Ax2tdg,8253
2
- omlish/__about__.py,sha256=oeR_9krsJobU57yaBP1YUrwkXI9RXjfl3IONZ25CSmw,3444
2
+ omlish/__about__.py,sha256=SFKaqgp4IDkB6oP2KqiAFc91BqMnf7A8BP4ZH_asPV8,3444
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
5
5
  omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
@@ -292,7 +292,7 @@ omlish/dispatch/_dispatch3.py,sha256=9Zjd7bINAC3keiaBdssc4v5dY0-8OI6XooV2DR9U7Z0
292
292
  omlish/dispatch/dispatch.py,sha256=KA5l49AiGLRjp4J7RDJW9RiDp9WUD1ewR1AOPEF8g38,3062
293
293
  omlish/dispatch/functions.py,sha256=cwNzGIg2ZIalEgn9I03cnJVbMTHjWloyDTaowlO3UPs,1524
294
294
  omlish/dispatch/impls.py,sha256=K_okKvpZml4NkTHJmTVyMQSrIaIJcqTEgkreGwukaOw,1895
295
- omlish/dispatch/methods.py,sha256=K5w9Bb4jjCEpz3H95VMsv8ITXSO_7F6Jp5K5Fcd4gjQ,6955
295
+ omlish/dispatch/methods.py,sha256=CeGVwiUdeadzyOe0xQVY_jegyj0tdHLQZpaIlLkJNnY,7330
296
296
  omlish/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
297
297
  omlish/docker/all.py,sha256=xXRgJgLGPwAtr7bDMJ_Dp9jTfOwfGvohNhc6LsoELJc,514
298
298
  omlish/docker/cli.py,sha256=gtb9kitVfGnd4cr587NsVVk8D5Ok5y5SAsqD_SwGrSA,2565
@@ -831,9 +831,9 @@ omlish/typedvalues/holder.py,sha256=4SwRezsmuDDEO5gENGx8kTm30pblF5UktoEAu02i-Gk,
831
831
  omlish/typedvalues/marshal.py,sha256=Rr-4DZ90BoD5Z9gT18QhZH2yMA3-gPJBK8GUrGkp8VA,4245
832
832
  omlish/typedvalues/reflect.py,sha256=y_7IY8_4cLVRvD3ug-_-cDaO5RtzC1rLVFzkeAPALf8,683
833
833
  omlish/typedvalues/values.py,sha256=Q_5IiQM3Vka4wGVd-scaslb4-oCMjFcIOksIrKE-JIM,1229
834
- omlish-0.0.0.dev290.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
835
- omlish-0.0.0.dev290.dist-info/METADATA,sha256=mlzTXMgNxL2crv8buBrhFsKzvguDXk_sMGiWLJEKHZc,4316
836
- omlish-0.0.0.dev290.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
837
- omlish-0.0.0.dev290.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
838
- omlish-0.0.0.dev290.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
839
- omlish-0.0.0.dev290.dist-info/RECORD,,
834
+ omlish-0.0.0.dev291.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
835
+ omlish-0.0.0.dev291.dist-info/METADATA,sha256=tzdVbypnyyv__ufhPd-jD_Z2x6cwVBxeKlHGnnapJRs,4316
836
+ omlish-0.0.0.dev291.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
837
+ omlish-0.0.0.dev291.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
838
+ omlish-0.0.0.dev291.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
839
+ omlish-0.0.0.dev291.dist-info/RECORD,,