Skip to content

Add factory-method-python materials folder - #975

Merged
realpython-bot merged 2 commits into
masterfrom
maintenance/factory-method-python-20261201
Dec 2, 2026
Merged

realpython-bot merged 2 commits 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

@realpython-bot
realpython-bot merged commit c76145f into master Dec 2, 2026
1 check passed
@realpython-bot
realpython-bot deleted the maintenance/factory-method-python-20261201 branch December 2, 2026 07:05
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