bazelbuild / bazelbuild/starlark
Specify what happens when builtin methods operate recursively on cyclic structures
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 178
- PR merge metrics
- No merged PRs in 30d
Description
Creating a cyclic structure is allowed, even with recursion disabled. But builtin methods can perform their own recursion over a hierarchical structure. We should specify whether implementations are obligated to handle this case gracefully, and whether gracefully means failing, or succeeding with a well-defined behavior, or either.
```
a = []
a.append(a)
print(a) # or str, or repr
```
See also bazelbuild/bazel#4295 for the Java interpreter specifically.
Contributor guide
Research direction
Review how print, str, and repr behave for the cyclic structure in the example, and compare the Java interpreter discussed in bazelbuild/bazel#4295. Resolve whether implementations must handle such recursion and define whether graceful handling means failure, a specified result, or either.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100