GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Switch frozen-instance error type from TypeError to dataclasses.FrozenInstanceError · Issue #102 · Technologicat/unpythonic

Switch frozen-instance error type from TypeError to dataclasses.FrozenInstanceError #102

New issue
Copy link
New issue
Copy link
Open
Open
Switch frozen-instance error type from TypeError to dataclasses.FrozenInstanceError#102
Copy link
Milestone
3.0.0

Description

@Technologicat
Technologicat
opened on May 6, 2026
Issue body actions

Spun off from #35 (closed in 2.2.0): the immutability cleanup for unpythonic.llist.cons (and any future "frozen" types in this codebase) shipped raising TypeError to preserve API stability under the 2.x compatibility promise.

Standard library convention since Python 3.7 is dataclasses.FrozenInstanceError for "tried to mutate a frozen instance." Aligning is desirable for ecosystem consistency, but FrozenInstanceError subclasses AttributeError, not TypeError. Switching is therefore a breaking change for any user code catching TypeError from a cons mutation attempt — appropriate for a major-version bump.

Scope

  • unpythonic/llist.py: cons.__setattr__ and cons.__delattr__ raise dataclasses.FrozenInstanceError instead of TypeError.
  • Tests: update unpythonic/tests/test_llist.py immutability assertions to expect FrozenInstanceError (or AttributeError).
  • CHANGELOG: Changed (breaking) entry under 3.0.0.
  • Audit any other "frozen" types added between now and 3.0.0 for the same alignment.

Notes

  • assignonce.__delattr__ (added in 2.2.0) raises AttributeError, which already aligns naturally — leave alone.
  • frozendict does not currently lock down attribute writes (only mapping writes); this issue is about types whose contract is "frozen instance."

— Claude (Opus 4.7)

Activity

  1. Technologicat
    added this to the 3.0.0 milestone on May 6, 2026
  2. Technologicat
    added a commit that references this issue on May 6, 2026

    llist: cons __delattr__ + simplify via object.__setattr__

    ee66ff7
  3. Technologicat commented on May 6, 2026

    @Technologicat
    Technologicat
    on May 6, 2026
    OwnerAuthor
    More actions

    Update: shim approach landed in 2.2.0. unpythonic.llist.FrozenAttributeError multiply-inherits from TypeError and dataclasses.FrozenInstanceError; cons raises this. Either except TypeError or except FrozenInstanceError catches.

    Scope of this issue therefore shifts:

    • 3.0.0 work is now to drop the TypeError base from FrozenAttributeError (or replace usages with plain FrozenInstanceError and remove the shim class).
    • The compat-during-2.x problem is solved; this is a clean stdlib-alignment step for 3.0.0.

    — Claude (Opus 4.7)

  4. Technologicat
    added a commit that references this issue on May 6, 2026

    llist: FrozenAttributeError shim, raised by cons

    2798d86
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      • 3.0.0No due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.