Different Method Types
Learn about the different types of method types along with an overview of what setattr is and how it works.
We'll cover the following...
Different types of methods
In the last lesson, we introduced the methods _make_train_step
and _make_val_step
and noticed these methods having an underscore as a prefix. Why is this so and how is this different from the double underscore in the __init__
method?"
Let us take a look at why this is the case.
Public, protected, and private methods
Some programming languages like Java have three kinds of methods: public, protected, and private.
Public methods are the kind you are most familiar with; they can be called by the user.
Protected methods, on the other hand, should not be called by the user. They are ...