wrapt 2.0.0rc5__cp311-cp311-macosx_10_9_universal2.whl → 2.0.0rc6__cp311-cp311-macosx_10_9_universal2.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 wrapt might be problematic. Click here for more details.

wrapt/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Wrapt is a library for decorators, wrappers and monkey patching.
3
3
  """
4
4
 
5
- __version_info__ = ("2", "0", "0", "rc5")
5
+ __version_info__ = ("2", "0", "0", "rc6")
6
6
  __version__ = ".".join(__version_info__)
7
7
 
8
8
  from .__wrapt__ import (
wrapt/_wrappers.c CHANGED
@@ -1658,16 +1658,51 @@ static PyObject *WraptObjectProxy_inplace_matrix_multiply(
1658
1658
  if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
1659
1659
  other = ((WraptObjectProxyObject *)other)->wrapped;
1660
1660
 
1661
- object = PyNumber_InPlaceMatrixMultiply(self->wrapped, other);
1661
+ if (PyObject_HasAttrString(self->wrapped, "__imatmul__"))
1662
+ {
1663
+ object = PyNumber_InPlaceMatrixMultiply(self->wrapped, other);
1662
1664
 
1663
- if (!object)
1664
- return NULL;
1665
+ if (!object)
1666
+ return NULL;
1665
1667
 
1666
- Py_DECREF(self->wrapped);
1667
- self->wrapped = object;
1668
+ Py_DECREF(self->wrapped);
1669
+ self->wrapped = object;
1668
1670
 
1669
- Py_INCREF(self);
1670
- return (PyObject *)self;
1671
+ Py_INCREF(self);
1672
+ return (PyObject *)self;
1673
+ }
1674
+ else
1675
+ {
1676
+ PyObject *result = PyNumber_MatrixMultiply(self->wrapped, other);
1677
+
1678
+ if (!result)
1679
+ return NULL;
1680
+
1681
+ PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
1682
+
1683
+ if (!proxy_type)
1684
+ {
1685
+ Py_DECREF(proxy_type);
1686
+ return NULL;
1687
+ }
1688
+
1689
+ PyObject *proxy_args = PyTuple_Pack(1, result);
1690
+
1691
+ Py_DECREF(result);
1692
+
1693
+ if (!proxy_args)
1694
+ {
1695
+ Py_DECREF(proxy_type);
1696
+ return NULL;
1697
+ }
1698
+
1699
+ PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
1700
+
1701
+ Py_DECREF(proxy_type);
1702
+ Py_DECREF(proxy_args);
1703
+
1704
+ return proxy_instance;
1705
+ }
1671
1706
  }
1672
1707
 
1673
1708
  /* ------------------------------------------------------------------------- */
Binary file
wrapt/wrappers.py CHANGED
@@ -490,8 +490,11 @@ class ObjectProxy(with_metaclass(_ObjectProxyMetaType)): # type: ignore[misc]
490
490
  return other @ self.__wrapped__
491
491
 
492
492
  def __imatmul__(self, other):
493
- self.__wrapped__ @= other
494
- return self
493
+ if hasattr(self.__wrapped__, "__imatmul__"):
494
+ self.__wrapped__ @= other
495
+ return self
496
+ else:
497
+ return self.__object_proxy__(self.__wrapped__ @ other)
495
498
 
496
499
  def __len__(self):
497
500
  return len(self.__wrapped__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wrapt
3
- Version: 2.0.0rc5
3
+ Version: 2.0.0rc6
4
4
  Summary: Module for decorators, wrappers and monkey patching.
5
5
  Home-page: https://github.com/GrahamDumpleton/wrapt
6
6
  Author: Graham Dumpleton
@@ -1,18 +1,18 @@
1
- wrapt-2.0.0rc5.dist-info/RECORD,,
2
- wrapt-2.0.0rc5.dist-info/WHEEL,sha256=VWNc5NH4DDoQDkc74R-nMZPza3RGJ6ac2abjVbvC-0k,141
3
- wrapt-2.0.0rc5.dist-info/top_level.txt,sha256=Jf7kcuXtwjUJMwOL0QzALDg2WiSiXiH9ThKMjN64DW0,6
4
- wrapt-2.0.0rc5.dist-info/METADATA,sha256=AodtQOhIu5GHSuKT_mm0Auf-MYxFecLHeS3NW24gnSE,8831
5
- wrapt-2.0.0rc5.dist-info/licenses/LICENSE,sha256=mrxBqmuGkMB-3ptEt8YjPQFCkO0eO1zMN-KSKVtdBY8,1304
6
1
  wrapt/importer.py,sha256=E16XxhomZuX5jM_JEH4ZO-MYpNou1t5RZLJHWLCtsgM,12135
7
2
  wrapt/__init__.pyi,sha256=sEJ93UmAcYesuYzTdyhmqCX5dQWyfD5IIJKT-wox3R8,9316
8
3
  wrapt/arguments.py,sha256=q4bxH7GoCXhTCgxy-AEyvSnOq0ovMSHjN7ru3HWxlhA,2548
9
- wrapt/__init__.py,sha256=63SajwhyAXfqtZmgp5ok0hTKnMc2coc37Zk0YLzibxE,1528
4
+ wrapt/__init__.py,sha256=4GvDdAUm7sO2zUv-Ai6tRo4TFCbZl_R3KzK59wzjfLI,1528
10
5
  wrapt/__wrapt__.py,sha256=E_Yo7fIk51_OjMzlqXKtIhvplbYbJIPcTGD20b0GWM8,1431
11
6
  wrapt/patches.py,sha256=WJAKwOEeozpqgLAq_BlEu2HWbjMg9yaR65szi8J4GRQ,9907
12
- wrapt/wrappers.py,sha256=xUYyI8ID4gIuUqfu4OP-d8t37SYZVducOfXEVhyhbj8,34297
7
+ wrapt/wrappers.py,sha256=btpuNklFXdpnWlQVrgib1cY08M5tm1vTSd_XEjfEgxs,34439
13
8
  wrapt/proxies.py,sha256=x9mergCbZIW4pplUmACkSU6iH0iWy9xNadQUoSp3ksA,10018
14
9
  wrapt/weakrefs.py,sha256=5HehYcKOKsRIghxLwnCZ4EJ67rhc0z1GH__pRILRLDc,4630
15
10
  wrapt/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
16
- wrapt/_wrappers.cpython-311-darwin.so,sha256=MwQaQtohrZtJHLip6APnWP0VvzQb5qd_ZPPN_DJ8QK0,153840
17
- wrapt/_wrappers.c,sha256=LKRxEkHK-ERyzbHO_cNm6KRRj6FP0C7bUzLtGwxSJqA,115105
11
+ wrapt/_wrappers.cpython-311-darwin.so,sha256=omr9RTpvdtN-gPedTdF7DV0vsDO4IpkDqZB167o5v3Y,153840
12
+ wrapt/_wrappers.c,sha256=ux1b_-Me_8QpJ_QRWvCq9jt_1CZ-9TFA-cVSLqi4_Zg,115800
18
13
  wrapt/decorators.py,sha256=ePWsg43Q5uHYSBGvbybwIZpsYdIhLGX9twbGZ7ygous,21091
14
+ wrapt-2.0.0rc6.dist-info/RECORD,,
15
+ wrapt-2.0.0rc6.dist-info/WHEEL,sha256=VWNc5NH4DDoQDkc74R-nMZPza3RGJ6ac2abjVbvC-0k,141
16
+ wrapt-2.0.0rc6.dist-info/top_level.txt,sha256=Jf7kcuXtwjUJMwOL0QzALDg2WiSiXiH9ThKMjN64DW0,6
17
+ wrapt-2.0.0rc6.dist-info/METADATA,sha256=PJAKVeZj-bxtyCPugdXc44LseD2LTYHJe_zsgpD9tec,8831
18
+ wrapt-2.0.0rc6.dist-info/licenses/LICENSE,sha256=mrxBqmuGkMB-3ptEt8YjPQFCkO0eO1zMN-KSKVtdBY8,1304