Skip to content

Commit 7fd416b

Browse files
committed
issues.md: Create examples folder
Signed-off-by: Tzanko Matev <[email protected]>
1 parent 46dc48e commit 7fd416b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

examples/hello.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def f(a, b):
2+
if a>0:
3+
return f(a-1, b+1)
4+
else:
5+
return b
6+
7+
print(f(5,1))
8+

issues.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,34 @@ defensive fallbacks, and ISSUE-008 focused specifically on `**kwargs`.
295295

296296
### Status
297297
Low priority. We won't work on this until a user reports that it causes issues.
298+
299+
## ISSUE-011
300+
### Description
301+
Create a concise set of small Python example scripts to exercise key code paths of the Rust‑backed recorder during development. Place all examples under `/examples` and make them easy to run with the module CLI.
302+
303+
### Definition of Done
304+
- Create `/examples` at repo root.
305+
- Add minimal, deterministic scripts covering common scenarios:
306+
- `basic_args.py`: positional‑only, pos‑or‑kw, kw‑only, `*args`, `**kwargs`.
307+
- `exceptions.py`: raise, catch, and `print(e)` inside `except`.
308+
- `classes_methods.py`: instance, `@classmethod`, `@staticmethod`, property access.
309+
- `recursion.py`: direct and mutual recursion.
310+
- `generators_async.py`: generator, `async`/`await`, async generator.
311+
- `context_and_closures.py`: `with` (context manager) and nested closures.
312+
- `threading.py`: two threads invoking traced functions and joining.
313+
- `imports_side_effects.py`: module‑level code vs `if __name__ == "__main__"`.
314+
- `kwargs_nested.py`: nested kwargs structure to validate structured encoding.
315+
- Each script:
316+
- Has a brief module docstring stating its focus.
317+
- Defines `main()` and uses the `__name__ == "__main__"` guard.
318+
- Produces stable, minimal output without external dependencies.
319+
- Add `/examples/README.md` listing scripts, purpose, and how to run via:
320+
- `python -m codetracer_python_recorder --codetracer-format=json examples/<script>.py`
321+
322+
### Proposed solution
323+
- Keep scripts focused and short to spotlight specific behaviors.
324+
- Prefer deterministic flows; join threads and avoid non‑deterministic timing.
325+
- Use the provided module CLI so recorder activation is consistent across runs.
326+
327+
### Status
328+
Todo

0 commit comments

Comments
 (0)