wrapt 2.0.0rc5__cp311-cp311-win_amd64.whl → 2.0.0rc6__cp311-cp311-win_amd64.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,8 +1,8 @@
1
- wrapt/__init__.py,sha256=Q-0pC9jo79xnZvORHx9LgMXEf985YbCk-K24uUkJHls,1591
1
+ wrapt/__init__.py,sha256=OvuYIm6ApyLYhCfKLMMx8lkysIDX4W2SQkxhuq7pPFo,1591
2
2
  wrapt/__init__.pyi,sha256=6ZgAOHLYbSsE0hfcayTFUIH0sZkR2Mo13CbeZRstcHc,9631
3
3
  wrapt/__wrapt__.py,sha256=hF01bdl0BhpXsSAmBIv3Zux3VNwsGXhoWQhj6kcDt6I,1475
4
- wrapt/_wrappers.c,sha256=8y2AFO3p-ilIOZtMVQMtcNpyaxT2V92agLu7g0I9gk8,119167
5
- wrapt/_wrappers.cp311-win_amd64.pyd,sha256=bm2UueaoBf8qXAaPSZngort3roQDlVekdkW6Xp0zXDo,43008
4
+ wrapt/_wrappers.c,sha256=CHiGjkkz7YlPj4aPW8hp0W4rHSPg7ftc5mCnBzHEerU,119897
5
+ wrapt/_wrappers.cp311-win_amd64.pyd,sha256=FnB8n-X8WC8zstZ-Xtc7Giec3W_2_llPKIv2fRJk7lY,43008
6
6
  wrapt/arguments.py,sha256=PiJtDy6JMT_0BQei7ZhxJXePIMYyk4GbHFjkTa0n9Q4,2607
7
7
  wrapt/decorators.py,sha256=DUSiYLn_xgxLvbEesol1tbmufvmn8Q6l6gcVnrU6RDU,21613
8
8
  wrapt/importer.py,sha256=NdOh6aVIIg5Fi1S8eLKL-wmX3qZ6SgOdk3_Xy7RQ5Q4,12467
@@ -10,9 +10,9 @@ wrapt/patches.py,sha256=yYh5_hXX-pIb8HyIs37MwCD6vUTeR96gsxd4W1N-mkw,10146
10
10
  wrapt/proxies.py,sha256=jMB_MxrlxF8guNHL6WXKFjuuHZndv4zAXfGaHObZPxk,10300
11
11
  wrapt/py.typed,sha256=2Ox0AU4FNnXJ0T5LyWKc_BbJXopWJJUFe8o2V7Zhvjc,9
12
12
  wrapt/weakrefs.py,sha256=IlTqGPbJ3mENcvPCboI0tYAzrhZg34cgRqWrP23GkHc,4744
13
- wrapt/wrappers.py,sha256=h_M2BZyoOm9KJmzTUmhTmLz2-LAXtZ4JtVrZ9KdD0a4,35274
14
- wrapt-2.0.0rc5.dist-info/licenses/LICENSE,sha256=ROwiyK8_2l1SENok8IcFjc-zHUnlK1JrE_454sDRC-4,1328
15
- wrapt-2.0.0rc5.dist-info/METADATA,sha256=CqN_5FKP4kbK3AD7MTBmkNTeA7MQjj3GqgtZv8cs7Z4,9029
16
- wrapt-2.0.0rc5.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
17
- wrapt-2.0.0rc5.dist-info/top_level.txt,sha256=Jf7kcuXtwjUJMwOL0QzALDg2WiSiXiH9ThKMjN64DW0,6
18
- wrapt-2.0.0rc5.dist-info/RECORD,,
13
+ wrapt/wrappers.py,sha256=PA3nS-5AW8BS5WYKqN32dsxKgLw0sTMcupLPABaLI-Q,35419
14
+ wrapt-2.0.0rc6.dist-info/licenses/LICENSE,sha256=ROwiyK8_2l1SENok8IcFjc-zHUnlK1JrE_454sDRC-4,1328
15
+ wrapt-2.0.0rc6.dist-info/METADATA,sha256=FUH4kWyhbTu3os8xJZfQbyKBbySt0iW4YjmB29-RDd8,9029
16
+ wrapt-2.0.0rc6.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
17
+ wrapt-2.0.0rc6.dist-info/top_level.txt,sha256=Jf7kcuXtwjUJMwOL0QzALDg2WiSiXiH9ThKMjN64DW0,6
18
+ wrapt-2.0.0rc6.dist-info/RECORD,,