Skip to content

Smoother abstract / Protocol -> implementation binding, with clearer scope- and cycle-violation diagnostics #444

Description

@lesnik512

Migrated from ROADMAP.md's ## Under consideration section, which is being deleted — an unscheduled item belongs in the tracker, not in a third hand-maintained file. See #438.

Why it is open

Two related rough edges, stated as one roadmap line:

  • Binding an abstract base or Protocol to a concrete implementation. Today
    this is Alias, or a Factory registered under the abstract type. Whether
    that is ergonomic enough is the open question.
  • Diagnostics for scope- and cycle-violations on those graphs.

What already exists

validate() walks the graph for missing providers, scope-direction violations,
and cycles, and reports them all at once; the error classes in
modern_di/exceptions.py render the arrow-tree chain and "did you mean"
suggestions. A proposal here has to name what those messages fail to say, not
restate that diagnostics matter.

Note that 0025-alias-binds-nothing
already settles what Alias is and is not; re-proposing it as a binding
mechanism is closed.

Revisit trigger

A concrete graph whose scope or cycle error message left the reporter unable to
find the offending edge, or a binding case the current primitives cannot state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageMaintainer needs to evaluate this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions