I am trying to understand object oriented programming of python.
In the following code when I omit class Dataset and pass statement from function read_data_set and try to create object without giving some argument - I get error that positional arguments a missing. But when I run this code without omitting anything it works fine even if I don't mention positional arguments while creating object.
Why it doesn't raise error in this case? Can someone please guide me whats going on in the following code?
Secondly I also want to know that when I mention class Dataset with a pass statement does it mean that I am creating a new class or does it mean I am just redefining this?
class Dataset:
def __init__(self,MC_sample,MC_label):
self.__MC_sample = MC_sample
self.__MC_label = MC_label
def read_data_set():
class Dataset:
pass
data_sets = Dataset() #object created
return data_sets