apache / apache/beam

Handle trivial inference with default arguments

Open
#18,613 0 comments 0 reactions 0 assignees View on GitHub
bug core P3 python
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
205

Description

make_function in opcodes.py was updated to make for-comprehensions compatible with Python 3. Currently, functions that have default arguments are unsupported. Default arguments will be left on the stack, affecting how future instructions are processed.

Imported from Jira [BEAM-3381](https://issues.apache.org/jira/browse/BEAM-3381). Original Jira may contain additional context.
Reported by: luke-zhu.

Contributor guide

Open the contributing guide

Research direction

Start by reading make_function in opcodes.py, focusing on how Python 3 for-comprehensions and default arguments are processed. Trace the stack after a function with default arguments is inferred, then add coverage for this case and verify that the defaults no longer affect subsequent instruction processing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.