Skip to content

Add factory-method-python materials folder - #975

Open
realpython-bot wants to merge 1 commit into
masterfrom
maintenance/factory-method-python-20261201
Open

realpython-bot wants to merge 1 commit into
masterfrom
maintenance/factory-method-python-20261201

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Adds the companion code for The Factory Method Pattern and Its Implementation in Python, which had no materials folder.

  • song_serializer/original and song_serializer/refactored: the SongSerializer before and after the Factory Method refactor, with a demo.py that replays the REPL session
  • object_serializer: serializers.py, songs.py, yaml_serializer.py and demo.py
  • music_services: object_factory.py, music.py (final MusicServiceProvider version) and program.py
  • requirements.txt pins PyYAML==6.0.4, matching the article's dependencies field

The files mirror the code in the full-update draft: https://realpython.com/pbjt/blog/post/2475/change/
Card: https://trello.com/c/cizJU5N1

Verified: every script run on Python 3.15.2 with PyYAML 6.0.4, and the output matches the article's REPL and console listings. ruff@0.14.1 format --check, ruff check, and dircheck.py pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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