News for hackers. Stuff that matters.
Re:Why general inheritance is flawed and how to finally fix it by nitroll on Monday December 13, 2021 @11:29AM (#29541092)
In Python you could do something like:

  class Base:
     def func(self):
         print("In Base.func:", self.name)
  
  class Child:
     def __init__(self, name):
         self.name = name
     func = Base.func
  
  c = Child("Foo")
  c.func() #=> In Base.func: Foo
Re:Why general inheritance is flawed and how to finally fix it by MillenialMan on Tuesday December 14, 2021 @06:49AM (#29550649)
The reason I'd like the construct is because it's explicit - intent (and the scope/limit of your intent) is encoded in what you create. It's clear you intend to do nothing with that name except symlink to the nested member, so the reader doesn't have to anticipate other behaviour (and can't accidentally do something else with it). Generic assignment doesn't convey the same restricted intent, and it doesn't carry those guard rails.

Really though it's a structure that only makes sense in strongly typed languages, so I probably shouldn't have used Python to illustrate the idea.