[Bugfix] Entity.visible_entities(radius=None) raises TypeError instead of applying the default #319

Closed
opened 2026-06-21 10:37:11 +00:00 by john · 0 comments
Owner

Found during the #314 F15 docstring-accuracy verify pass.

In src/UIEntity.cpp, visible_entities(fov=None, radius=...) parses radius with the PyArg format code i (format string "|Oi"). The i code does not accept Python None, so calling entity.visible_entities(radius=None) raises TypeError. The intended default only applies when radius is omitted entirely.

Impact: The natural radius=None ("use the default") call fails. Fix options: switch to O parsing with manual None→default handling, or document radius as a plain int with a real sentinel default.

The signature docstring/stub have been corrected (in the F15 accuracy pass) to stop implying radius=None is accepted; this issue tracks the code-level ergonomics fix.

Suggested labels: Bugfix, system:python-binding, priority:tier2-foundation. (Apply manually — Gitea MCP label bug.)

Refs #314

Found during the #314 F15 docstring-accuracy verify pass. In `src/UIEntity.cpp`, `visible_entities(fov=None, radius=...)` parses `radius` with the PyArg format code `i` (format string `"|Oi"`). The `i` code does **not** accept Python `None`, so calling `entity.visible_entities(radius=None)` raises `TypeError`. The intended default only applies when `radius` is omitted entirely. **Impact:** The natural `radius=None` ("use the default") call fails. Fix options: switch to `O` parsing with manual None→default handling, or document `radius` as a plain int with a real sentinel default. The signature docstring/stub have been corrected (in the F15 accuracy pass) to stop implying `radius=None` is accepted; this issue tracks the code-level ergonomics fix. Suggested labels: `Bugfix`, `system:python-binding`, `priority:tier2-foundation`. (Apply manually — Gitea MCP label bug.) Refs #314
john closed this issue 2026-06-21 14:12:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#319
No description provided.