linux.py uses Dict, List and Optional without importing them #29

Closed
opened 2026-10-14 08:22:58 +00:00 by christianmanivong · 0 comments
Owner

ruff check --select F821 napalm_linux/linux.py reports 30 undefined names: 12 × Dict, 16 × List, 2 × Optional. It only works because of from __future__ import annotations; typing.get_type_hints(LinuxDriver.get_route_to) raises NameError.

Fix: import them, or use the builtins. Add F821 to the lint run.

Part of NetOrk/netork#1105. Plan: NAPALM/napalm-device-types docs/STRUCTURE.md (branch docs/structure-plan).

Prio P4: no runtime failure today.

`ruff check --select F821 napalm_linux/linux.py` reports 30 undefined names: 12 × `Dict`, 16 × `List`, 2 × `Optional`. It only works because of `from __future__ import annotations`; `typing.get_type_hints(LinuxDriver.get_route_to)` raises `NameError`. Fix: import them, or use the builtins. Add F821 to the lint run. Part of NetOrk/netork#1105. Plan: NAPALM/napalm-device-types `docs/STRUCTURE.md` (branch `docs/structure-plan`). Prio P4: no runtime failure today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-linux#29