Different Method Types

Learn about the different types of method types along with an overview of what setattr is and how it works.

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.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy