Title: foreach would remove 1 item when validating generators · Issue #89 · formencode/formencode · GitHub
Open Graph Title: foreach would remove 1 item when validating generators · Issue #89 · formencode/formencode
X Title: foreach would remove 1 item when validating generators · Issue #89 · formencode/formencode
Description: When validating generators with foreach, _convert_to_list would remove 1 item. This is the culprit: for n in value: break return value Our workaround is to override _convert_to_list with the following: def _convert_to_list(self, value): ...
Open Graph Description: When validating generators with foreach, _convert_to_list would remove 1 item. This is the culprit: for n in value: break return value Our workaround is to override _convert_to_list with the follow...
X Description: When validating generators with foreach, _convert_to_list would remove 1 item. This is the culprit: for n in value: break return value Our workaround is to override _convert_to_list with the follow...
Opengraph URL: https://github.com/formencode/formencode/issues/89
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"foreach would remove 1 item when validating generators","articleBody":"When validating generators with `foreach`, `_convert_to_list` would remove 1 item.\n\nThis is the culprit:\n\n```\nfor n in value:\n break\nreturn value\n```\n\nOur workaround is to override `_convert_to_list` with the following:\n\n```\ndef _convert_to_list(self, value):\n if isinstance(value, types.GeneratorType):\n return list(value)\n else:\n return super(ListOf, self)._convert_to_list(value)\n```\n","author":{"url":"https://github.com/tinman6","@type":"Person","name":"tinman6"},"datePublished":"2015-08-11T16:01:38Z","url":"https://github.com/formencode/formencode/issues/89"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0c313a26-1d1e-c11c-456d-5a774bce16bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88C6:92683:5FB18:84752:6B046213 |
| html-safe-nonce | b72d7c442c0f46722c57f30483c7b2f6fd5572fdb0c5a384286549efa704e202 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEM2OjkyNjgzOjVGQjE4Ojg0NzUyOjZCMDQ2MjEzIiwidmlzaXRvcl9pZCI6Ijc4NDE5NzI2MDYyMDIwNDQ5NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b0b4627c6c450f7c28976cf507cd5de1563f027f96c72881683f2879fe20ade6 |
| hovercard-subject-tag | issue:100347007 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/formencode/formencode/89/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbafc32c982d537c0e65e2f579616276310505656452c2c64d1ea168b4a825a7/formencode/formencode/issues/89 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbafc32c982d537c0e65e2f579616276310505656452c2c64d1ea168b4a825a7/formencode/formencode/issues/89 |
| og:image:alt | When validating generators with foreach, _convert_to_list would remove 1 item. This is the culprit: for n in value: break return value Our workaround is to override _convert_to_list with the follow... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tinman6 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/formencode/formencode git https://github.com/formencode/formencode.git |
| octolytics-dimension-user_id | 1541742 |
| octolytics-dimension-user_login | formencode |
| octolytics-dimension-repository_id | 3733133 |
| octolytics-dimension-repository_nwo | formencode/formencode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3733133 |
| octolytics-dimension-repository_network_root_nwo | formencode/formencode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width