Putting Liskov substitution principal to one side, I had a suggestion
to follow PEP3102, and do `def train(self, *, epochs):`…
It's a rather simple suggestion that I just might take aboard.
In response to Dieter:
My purpose for using a base class is so that the highest level
interface—say a CLI,
Samuel Marks wrote at 2020-8-29 19:14 +1000:
>So there is no way to get a AOT error when the two functions aren't
>implemented, if the two functions have different required arguments on
>implementors?
>
>To paint this picture for why I need this, say the first is:
>
>class Base(ABC):
>@abstract
So there is no way to get a AOT error when the two functions aren't
implemented, if the two functions have different required arguments on
implementors?
To paint this picture for why I need this, say the first is:
class Base(ABC):
@abstractclass
def train(self, epochs):
asset epoc
Samuel Marks wrote at 2020-8-27 15:58 +1000:
>The main thing I want is type safety. I want Python to complain if the
>callee uses the wrong argument types, and to provide suggestions on
>what's needed and info about it.
>
>Without a base class I can just have docstrings and type annotations
>to ach
Samuel Marks wrote:
> The main thing I want is type safety. I want Python to complain if the
> callee uses the wrong argument types, and to provide suggestions on
> what's needed and info about it.
>
> Without a base class I can just have docstrings and type annotations
> to achieve that.
>
> Wh
The main thing I want is type safety. I want Python to complain if the
callee uses the wrong argument types, and to provide suggestions on
what's needed and info about it.
Without a base class I can just have docstrings and type annotations
to achieve that.
What can I use that will require all im
Samuel Marks wrote at 2020-8-24 18:24 +1000:
>After a discussion on #python on Freenode, I'm here.
>
>The gist of it is:
>> Falc - Signature of method 'Pharm.foo()' does not match signature of base
>> method in class 'Base'
>
>What's the right way of specialising the children and leaving the Base
After a discussion on #python on Freenode, I'm here.
The gist of it is:
> Falc - Signature of method 'Pharm.foo()' does not match signature of base
> method in class 'Base'
What's the right way of specialising the children and leaving the Base
pretty much empty?
Specifically I want:
• All imple