cirq-core 1.4.0.dev20231212184611__py3-none-any.whl → 1.4.0.dev20231213052953__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.
cirq/_compat.py CHANGED
@@ -67,6 +67,10 @@ except ImportError:
67
67
  from backports.cached_property import cached_property # type: ignore[no-redef]
68
68
 
69
69
 
70
+ # Sentinel used by wrapped_no_args below when method has not yet been cached.
71
+ _NOT_FOUND = object()
72
+
73
+
70
74
  TFunc = TypeVar('TFunc', bound=Callable)
71
75
 
72
76
 
@@ -103,9 +107,11 @@ def cached_method(method: Optional[TFunc] = None, *, maxsize: int = 128) -> Any:
103
107
 
104
108
  @functools.wraps(func)
105
109
  def wrapped_no_args(self):
106
- if not hasattr(self, cache_name):
107
- object.__setattr__(self, cache_name, func(self))
108
- return getattr(self, cache_name)
110
+ result = getattr(self, cache_name, _NOT_FOUND)
111
+ if result is _NOT_FOUND:
112
+ result = func(self)
113
+ object.__setattr__(self, cache_name, result)
114
+ return result
109
115
 
110
116
  return wrapped_no_args
111
117
 
cirq/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.4.0.dev20231212184611"
1
+ __version__ = "1.4.0.dev20231213052953"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.4.0.dev20231212184611
3
+ Version: 1.4.0.dev20231213052953
4
4
  Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
5
5
  Home-page: http://github.com/quantumlib/cirq
6
6
  Author: The Cirq Developers
@@ -1,10 +1,10 @@
1
1
  cirq/__init__.py,sha256=GlOnPWDvat-Y203LsbXhkC0UnGm9HHiNx2ywz7Bkc3o,15708
2
- cirq/_compat.py,sha256=YPvewnC0gajEIRjauyz_EuDzs38g-bIBkY_0h91U4Pc,29363
2
+ cirq/_compat.py,sha256=wXi3WIiKjfJp5mCB2Kha3LyfJzxCetEPXq5-wg_faq0,29536
3
3
  cirq/_compat_test.py,sha256=iQJYqIP1uyRe8mNUwi2VKccyUaJDFYH7b3Fg6cqQLQw,35053
4
4
  cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
5
5
  cirq/_import.py,sha256=p9gMHJscbtDDkfHOaulvd3Aer0pwUF5AXpL89XR8dNw,8402
6
6
  cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
7
- cirq/_version.py,sha256=ywI9aIFRn8WEH3oFnG3TXMWOuybY0BLJRgXBZJ6_ho4,40
7
+ cirq/_version.py,sha256=5BflzysMAyRqe_b0UdXrn1dsFHn4_HU5M2hi7tT9hLg,40
8
8
  cirq/_version_test.py,sha256=yYS6xm5-nuBRQJa9R3n41WdvFtVyY7Lb5Q8bea3VgBI,133
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=S0HaPOCUIck-vNSQlS6KxnQtle6w-2dGuSxkUbJQY9Y,13168
@@ -1148,8 +1148,8 @@ cirq/work/sampler.py,sha256=JVv1vvfa6EgFiR3UeDk44U186dCrioH2NZXueCgsb9w,19828
1148
1148
  cirq/work/sampler_test.py,sha256=zo1Hj6sn6fLs_WZMxYRApBqgBsldmptn74NL0jhNukc,12325
1149
1149
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1150
1150
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1151
- cirq_core-1.4.0.dev20231212184611.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1152
- cirq_core-1.4.0.dev20231212184611.dist-info/METADATA,sha256=3cxshJdmtiv6uZBW-sHcPtIbAlXnDdYztpa4ao1me5o,2075
1153
- cirq_core-1.4.0.dev20231212184611.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
1154
- cirq_core-1.4.0.dev20231212184611.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1155
- cirq_core-1.4.0.dev20231212184611.dist-info/RECORD,,
1151
+ cirq_core-1.4.0.dev20231213052953.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1152
+ cirq_core-1.4.0.dev20231213052953.dist-info/METADATA,sha256=fBBxFnFXGTEOM1YoLvWgYEHKR3V-wg0iX5m2Dgs8g3c,2075
1153
+ cirq_core-1.4.0.dev20231213052953.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
1154
+ cirq_core-1.4.0.dev20231213052953.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1155
+ cirq_core-1.4.0.dev20231213052953.dist-info/RECORD,,