Title: Naming collision between Processing `map()` and Python `map()` · Issue #131 · processing/libprocessing · GitHub
Open Graph Title: Naming collision between Processing `map()` and Python `map()` · Issue #131 · processing/libprocessing
X Title: Naming collision between Processing `map()` and Python `map()` · Issue #131 · processing/libprocessing
Description: Trying to port the array example (See issue: Port Basics / Arrays / Array #3) and I'm running into this error: coswave = [abs(cos(map(i, 0, width, 0, pi))) for i in range(width)] ~~~^^^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not ite...
Open Graph Description: Trying to port the array example (See issue: Port Basics / Arrays / Array #3) and I'm running into this error: coswave = [abs(cos(map(i, 0, width, 0, pi))) for i in range(width)] ~~~^^^^^^^^^^^^^^^...
X Description: Trying to port the array example (See issue: Port Basics / Arrays / Array #3) and I'm running into this error: coswave = [abs(cos(map(i, 0, width, 0, pi))) for i in range(width)] ~~~^^^^^^^^^^^...
Opengraph URL: https://github.com/processing/libprocessing/issues/131
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Naming collision between Processing `map()` and Python `map()`","articleBody":"Trying to port the array example (See issue: [Port `Basics` / `Arrays` / `Array` #3](https://github.com/processing/processing-examples-mewnala/issues/3)) and I'm running into this error:\n\n```\ncoswave = [abs(cos(map(i, 0, width, 0, pi))) for i in range(width)]\n ~~~^^^^^^^^^^^^^^^^^^^^\nTypeError: 'int' object is not iterable\n```\n\nI suppose this is because Python has its own [map()](https://www.w3schools.com/python/ref_func_map.asp) function (a list transformation) different from the [map()](https://processing.org/reference/map_.html) function in Processing (a linear interpolation function).\n\nProcessing.py handles this by wrapping `map()` and dispatching based on the arguments (see [source code](https://github.com/jdf/processing.py/blob/1932b4ca71f3befd333cc23d3a1c8fe7617014ff/runtime/src/jycessing/PAppletJythonDriver.java#L1047)). It uses the Processing version when called with five numeric arguments, and otherwise falls back to Python’s built-in. Note: the same approach is used for `filter()`.\n\nBy contrast, py5 avoids the conflict by renaming the function to [`remap()`](https://py5coding.org/reference/sketch_remap.html) instead.\n","author":{"url":"https://github.com/SableRaf","@type":"Person","name":"SableRaf"},"datePublished":"2026-04-24T13:06:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/131/libprocessing/issues/131"}
| 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:dbbe8c77-0c7f-442c-56c5-23817c043b03 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAD8:D3A0E:12F02EE:1952E10:6A5D1553 |
| html-safe-nonce | c5a0486aef36c8c44f02e4e371b20dfac22a924406bf409eeb1c509bb1e9db4f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUQ4OkQzQTBFOjEyRjAyRUU6MTk1MkUxMDo2QTVEMTU1MyIsInZpc2l0b3JfaWQiOiI4NjAwMTY4ODkwOTY1NDk3MTcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 373539eb8e0233903d957197ccf7ef68225740385b430985b82ec6a7cbbcffab |
| hovercard-subject-tag | issue:4323106606 |
| 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/processing/libprocessing/131/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f67885124411347faf1b319eaacc7e1fc3cd8258cd0090535b1e4b8fb14b884d/processing/libprocessing/issues/131 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f67885124411347faf1b319eaacc7e1fc3cd8258cd0090535b1e4b8fb14b884d/processing/libprocessing/issues/131 |
| og:image:alt | Trying to port the array example (See issue: Port Basics / Arrays / Array #3) and I'm running into this error: coswave = [abs(cos(map(i, 0, width, 0, pi))) for i in range(width)] ~~~^^^^^^^^^^^^^^^... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SableRaf |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/libprocessing git https://github.com/processing/libprocessing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 1101329545 |
| octolytics-dimension-repository_nwo | processing/libprocessing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1101329545 |
| octolytics-dimension-repository_network_root_nwo | processing/libprocessing |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width