Skip to content

semantic: from re import Error still runs while re.Error is SPY0202 — the from-import case-insensitive fallback binds any module's member by case #2132

Description

@antonsynd

ImportResolver (~ModuleLoading L747) applies a case-insensitive name fallback to every module's from-import: from re import Error RUNS (HEAD and BASE) although re.Error in annotation/except/isinstance position is SPY0202 per the P6 ruling (python: ImportError: cannot import name 'Error'); from errs import myerr for a user class myErr → SPY0908 CS0234 (BASE CS0426). The qualified/bare divergence meta-class: one resolution rule for module.Name in every position, no case fallback (or a steer only: "did you mean 'error'?").

Minor sibling: SPY0244's message leaks a CLR spelling — g: () -> int = lambda: None() → "… not 'int32'".


Found by /verify-implementation plan-0ca7b7 semantic fix lane (pre-existing at acd1d40 unless stated).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lane:silent-wrongCompiles and runs with wrong output or semantics (rank first)reach:programAn ordinary program a Python programmer would write hits it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions