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

📚 `ubquery.py` says `eval` resolves names eagerly; measured, it short-circuits exactly like the fast path

Open Beginner friendly
#2,255 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

The wrong claim sits in the module docstring at packages/sphinx-needs/src/sphinx_needs/ubquery.py lines 7-14. Before editing, run the two eval snippets quoted in the issue in a Python 3.13 shell to confirm the short-circuit and NameError behaviour. Done means the docstring gives cost, not short-circuit semantics, as the reason the fast path exists, and no longer says eval resolves names eagerly.

Written by the indexing model from the issue text.

Description

documentation pkg: sphinx-needs

The module docstring of packages/sphinx-needs/src/sphinx_needs/ubquery.py:7-14 says that per-type fields are "not possible with eval() since it eagerly evaluates all names in the expression context upfront", as the reason the fast path resolves names lazily.

Measured at master 3210ac5c (2026-10-14, CPython 3.13): eval('type == "nope" and absent_field == "x"', ctx) returns False with no error, and eval('absent_field == "x"', ctx) raises NameError. Python's eval resolves names lazily and short-circuits and/or exactly as ubquery does. What is eager on the eval path is building the context (every key materialised by filter_context()), not the name lookup — and that is where the eval path's cost is (13.9 of 14.0 ms per 10 000 needs for status == "open").

Fix the docstring: the fast path's advantage is cost (no context dict per need), not short-circuit semantics; a type-guarded expression over an absent field works on both paths.

Dominant language
Python
Stars
309
Forks
103
Avg merge
11h 26m
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 useblocks/sphinx-needs

All issues in useblocks/sphinx-needs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.