Skip to content

Sample code for: Implementing Interfaces in Python: ABCs and Protocols#758

Open
lpozo wants to merge 4 commits into
masterfrom
python-interface
Open

Sample code for: Implementing Interfaces in Python: ABCs and Protocols#758
lpozo wants to merge 4 commits into
masterfrom
python-interface

Conversation

@lpozo
Copy link
Copy Markdown
Contributor

@lpozo lpozo commented Apr 21, 2026

Code examples for the Implementing Interfaces in Python: ABCs and Protocols tutorial.

Generated from the tutorial markdown with the post-materials skill, then verified locally before pushing.

lpozo and others added 4 commits April 21, 2026 12:39
- Fix typo in check_protocols.py import (readers_protocols -> readers_protocol).
- Import runtime_checkable in readers_protocol.py so uncommenting the
  decorator doesn't NameError.
- Remove meta_classes.py and check_virtual_classes.py: the metaclass-based
  virtual subclass example was dropped from the updated tutorial in favor
  of typing.Protocol + @runtime_checkable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matches the tutorial's final state (highlighted block in the Runtime
Type-Checking Protocol Subtypes section) and silences the F401 ruff
error for the unused runtime_checkable import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant