workers-runtime-sdk 1.4.1__tar.gz → 1.4.2__tar.gz

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.
Files changed (17) hide show
  1. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/CHANGELOG.md +9 -0
  2. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/PKG-INFO +1 -1
  3. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/pyproject.toml +1 -1
  4. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/workers/_workers.py +23 -0
  5. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/.gitignore +0 -0
  6. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/AGENTS.md +0 -0
  7. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/README.md +0 -0
  8. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/_cloudflare_compat_flags.pyi +0 -0
  9. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/_pyodide_entrypoint_helper.pyi +0 -0
  10. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/_workers_sdk_entropy_import_context.pth +0 -0
  11. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/_workers_sdk_entropy_import_context.py +0 -0
  12. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/_workers_sdk_entropy_import_context_loader.py +0 -0
  13. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/asgi.py +0 -0
  14. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/workers/__init__.py +0 -0
  15. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/workers/py.typed +0 -0
  16. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/src/workers/workflows.py +0 -0
  17. {workers_runtime_sdk-1.4.1 → workers_runtime_sdk-1.4.2}/uv.lock +0 -0
@@ -2,6 +2,15 @@
2
2
 
3
3
  <!-- version list -->
4
4
 
5
+ ## v1.4.2 (2026-06-18)
6
+
7
+ ### Bug Fixes
8
+
9
+ - Make iterables work correctly when returned from rpc call
10
+ ([#127](https://github.com/cloudflare/workers-py/pull/127),
11
+ [`36dc659`](https://github.com/cloudflare/workers-py/commit/36dc659d6ba394d75e3d11b3e78e2b08fcd91c9f))
12
+
13
+
5
14
  ## v1.4.1 (2026-06-18)
6
15
 
7
16
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workers-runtime-sdk
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: Python SDK for Cloudflare Workers
5
5
  Project-URL: Homepage, https://github.com/cloudflare/workers-py
6
6
  Project-URL: Bug Tracker, https://github.com/cloudflare/workers-py/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "workers-runtime-sdk"
7
- version = "1.4.1"
7
+ version = "1.4.2"
8
8
  description = "Python SDK for Cloudflare Workers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -1122,6 +1122,14 @@ class _BindingWrapper:
1122
1122
  def __init__(self, binding):
1123
1123
  self._binding = binding
1124
1124
 
1125
+ @property
1126
+ def _real_name(self):
1127
+ js_name = _get_js_constructor_name(self._binding)
1128
+ if not js_name:
1129
+ # Should not happen, but just in case
1130
+ return type(self).__name__
1131
+ return js_name
1132
+
1125
1133
  def _should_wrap_nested_attribute(self, jsobj) -> bool:
1126
1134
  if not isinstance(jsobj, JsProxy):
1127
1135
  return False
@@ -1175,8 +1183,23 @@ class _BindingWrapper:
1175
1183
  return result
1176
1184
 
1177
1185
  def __getitem__(self, key):
1186
+ if isinstance(key, int):
1187
+ return self._convert_result(self._binding[key])
1178
1188
  return self._convert_result(getattr(self._binding, key))
1179
1189
 
1190
+ def __iter__(self):
1191
+ binding = self._binding
1192
+ if not hasattr(binding, "__iter__"):
1193
+ raise TypeError(f"'{self._real_name}' object is not iterable")
1194
+ for item in binding:
1195
+ yield self._convert_result(item)
1196
+
1197
+ def __len__(self):
1198
+ binding = self._binding
1199
+ if not hasattr(binding, "length"):
1200
+ raise TypeError(f"'{self._real_name}' object has no len()")
1201
+ return binding.length
1202
+
1180
1203
 
1181
1204
  class _FetcherWrapper(_BindingWrapper):
1182
1205
  def fetch(self, *args, **kwargs):