From e235f23fe84c2c48c1c9b2db67d0cd255c1a82ba Mon Sep 17 00:00:00 2001 From: "Richard S. Stewart" Date: Tue, 21 Feb 2023 18:03:25 -0600 Subject: [PATCH 1/2] Comment on similarity to Smalltalk practice. --- 2021/todo-abc.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/2021/todo-abc.md b/2021/todo-abc.md index 145122f..4ea54de 100644 --- a/2021/todo-abc.md +++ b/2021/todo-abc.md @@ -122,7 +122,12 @@ I concur. In the end, you're probably not even going to need that abstract base ## Discussion -No comments. Want to make a comment? Edit this page. Then submit a pull request. +Rich Stewart 2023-02-21 +Couldn't help noticing that this is close to the Smalltalk community's conventions for abstract classes. In most Smalltalks, there's a fundamental method, high up in the inheritance hierarchy, called ```subclassResponsibility```. So, any "abstract" method which ought to be implemented by a derived class sends ```subclassResponsibility``` to ```self```. If the method is not overridden, and then gets called at runtime, an exception gets raised. + +I was writing some Python myself and thinking about this, and cobbled together my own variation on ```subclassResponsibility``` in Python. It's much less complicated. + +Of course, yours is better at making Python IDE's highlight the problem "out of the box." From 7a0540cf0712752924fa4ce9068265d1e74b29f6 Mon Sep 17 00:00:00 2001 From: "Richard S. Stewart" Date: Tue, 21 Feb 2023 21:38:10 -0600 Subject: [PATCH 2/2] Refined the comments. --- 2021/todo-abc.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2021/todo-abc.md b/2021/todo-abc.md index 4ea54de..f8113e1 100644 --- a/2021/todo-abc.md +++ b/2021/todo-abc.md @@ -123,7 +123,8 @@ I concur. In the end, you're probably not even going to need that abstract base ## Discussion Rich Stewart 2023-02-21 -Couldn't help noticing that this is close to the Smalltalk community's conventions for abstract classes. In most Smalltalks, there's a fundamental method, high up in the inheritance hierarchy, called ```subclassResponsibility```. So, any "abstract" method which ought to be implemented by a derived class sends ```subclassResponsibility``` to ```self```. If the method is not overridden, and then gets called at runtime, an exception gets raised. + +Couldn't help noticing that this is close to the Smalltalk community's conventions for abstract classes. In most Smalltalks, there's a fundamental method, high up in the inheritance hierarchy, called ```subclassResponsibility```. So, any "abstract" method which ought to be implemented by a derived class sends ```subclassResponsibility``` to ```self```. If the method is not overridden, and then gets called at runtime, then ```subclassResponsibility``` is called and raises an exception . I was writing some Python myself and thinking about this, and cobbled together my own variation on ```subclassResponsibility``` in Python. It's much less complicated.