I was learning spark and came across this line
Your SparkSession has an attribute called
catalogwhich lists all the data inside the cluster. This attribute has a few methods for extracting different pieces of information. One of the most useful is the.listTables()method, which returns the names of al the tables in your cluster as a list e.g.spark.catalog.listTables().
My question is how an attribute can have methods in python. I tried to search a lot but could not find anything which could clear my confusion. I do know that class has attributes and methods and how to access them but I am confused that how can attribute(catalog) has methods(listTables()) and the way method is being called like catalog.listTables(). Can someone please share some examples or links. Thank you.