Search code examples
pythonpytube

Python pytube module internal explanation. How does a single assignment statement assign other fields to self?


Please take a look at these pictures, before & after. I want to know how a single assignment statement self.watch_url = f"https://youtube.com/watch?v={self.video_id}" changes self object totally. It's code snippet from the module "pytube".


Solution

  • So the thing is that when checking self on IDE debugger, it automatically invokes function with @property, which is the reason why other properties have data.