[Solved] How does Python interpret arguments in class definition?


  1. Tag is the class that BeautifoulSoup inherits from. It’s not an argument. Please take a look at this to learn more.

  2. As for the arguments in __init__: self refers to the instance of the class that will be created. The other arguments are written with default values, which means that they will take this value if not specified when you call the method. And as you did specify two arguments with no names in your example, the positional order will be used, that is to say markers=text and features=parser. Here would be a good way to start learning about it.


I’m not willing to sound harsh, but it might not be the best idea to start wandering in this source code while you are not familiar with the concepts of classes, objects, and some other basic stuff in Python.

2

solved How does Python interpret arguments in class definition?