Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Naming collision between Processing `map()` and Python `map()`

Open
#131 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python, rust
Domain
api

Research direction

Start with the array example and the map() collision described in the issue, then compare the referenced processing.py dispatch in PAppletJythonDriver.java with py5's remap() API. Determine which naming or dispatch behavior libprocessing should adopt, and consider the Python built-in compatibility implications. Done means the chosen API resolves the example without ambiguity and is documented or tested accordingly.

Written by the indexing model from the issue text.

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 iterable

I suppose this is because Python has its own map() function (a list transformation) different from the map() function in Processing (a linear interpolation function).

Processing.py handles this by wrapping map() and dispatching based on the arguments (see source code). 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().

By contrast, py5 avoids the conflict by renaming the function to remap() instead.

Dominant language
Rust
Stars
69
Forks
14
Avg merge
15d 22h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from processing/libprocessing

All issues in processing/libprocessing

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.