Skip to content

Fix patching abstract methods on ABCs - #966

Open
remote-controlled-man wants to merge 4 commits into
AnswerDotAI:mainfrom
remote-controlled-man:codex/prflow-f457fd03b7a7
Open

remote-controlled-man wants to merge 4 commits into
AnswerDotAI:mainfrom
remote-controlled-man:codex/prflow-f457fd03b7a7

Conversation

@remote-controlled-man

@remote-controlled-man remote-controlled-man commented Nov 14, 2026 •

Copy link
Copy Markdown

Closes #536.

@patch and @patch_to can now complete abstract classes incrementally. For classes using ABCMeta, refresh the abstract-method set after installing a method and keep abstract originals out of _orig_* aliases, which would otherwise add abstract requirements. Concrete originals and original methods on ordinary mixins remain available. The custom class-method descriptor also exposes its function's abstract marker so replacing a method with another abstract implementation keeps the class abstract.

Synced with main at f387a6a. The fix and regressions remain in ship/01_basics.ipynb. Fastship regenerates fastcore/basics.py and the new abstract-marker member entry in _modidx.py.

Validation on macOS, Python 3.12.14, Fastship 0.1.23:

  • The same @patch regression leaves the class abstract on unmodified main and instantiates it on this branch. The focused ABC tests also cover partial implementation, inheritance, properties, class and static methods, concrete originals, and ordinary mixins with an abstract marker.
  • All 23 notebooks and the literate fastcore/diff.py module passed through the ship-test entry point after preloading standard-library XML. The stock invocation hits the same XML import-shadowing error on both trees.
  • ship-clean leaves both trees clean. ship-export reports identical unrelated documentation-index changes on both trees. The ABC export is in sync, and git diff --check passed.

Other CI platforms and Python versions were not run locally.

AI assistance: OpenAI Codex assisted implementation, tests and independent review.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

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.

issue in patch decorator when worker with abstract classes

2 participants